I am trying to change/replaced the action attribute in a form but am having a problem with the selector. I want to change the action to ShoppingCart.asp?recal=Y
Here is the markup for the form.
<form onsubmit="if (typeof(Update_Hidden_State_Fields)=='function') Update_Hidden_State_Fields(); if (this.submitted) return false; else {this.submitted=true; return true;}" action="ShoppingCart.asp" name="form" method="POST">
Here is the Jquery I have so far.
$("[name='form']")
.attr('action', function(jj,ww){
return ww.replace('ShoppingCart.asp','ShoppingCart.asp?recal=Y');})
1 Answer