ACTION attribute
-
How can I programmaticaly change content of ACTION attribute? When I click on submit button, it doesn't redirect to URL specified in ACTION attribute. Why?:confused:
We had this problem too. If you view the source of the page, you'll see that .Net has overwritten your action to postback. You might want to put this form on your .aspx page and take out the runat="server" attributes. Don't mess with the form that .Net puts there, just leave it.
-
We had this problem too. If you view the source of the page, you'll see that .Net has overwritten your action to postback. You might want to put this form on your .aspx page and take out the runat="server" attributes. Don't mess with the form that .Net puts there, just leave it.
I think I found a solution:cool:: <!-- function ChangeAction() { var theform = document.NameOfTheForm; theform.action = "http://somelink"; } // --> I call this Javascript function on Submit Button clicked and it works!:-D
-
I think I found a solution:cool:: <!-- function ChangeAction() { var theform = document.NameOfTheForm; theform.action = "http://somelink"; } // --> I call this Javascript function on Submit Button clicked and it works!:-D
horvat wrote: I call this Javascript function on Submit Button clicked and it works I came to the same conclusion :-D But I put that javascript in the ONLOAD event of the BODY element. The form is not always submitted by the INPUT button. On second thought though maybe in the ONSUBMIT of the form will be better.
Paul Watson
Bluegrass
Cape Town, South AfricaMacbeth muttered: I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er DavidW wrote: You are totally mad. Nice.
-
I think I found a solution:cool:: <!-- function ChangeAction() { var theform = document.NameOfTheForm; theform.action = "http://somelink"; } // --> I call this Javascript function on Submit Button clicked and it works!:-D
If you absolutely must change the action property of the form, a better solution would be to go grab my free CustomForm[^] control. This won't required script support on the client. Just set the Action property on the form as usual.