shiny_spoon Posted October 11, 2006 Share Posted October 11, 2006 Is it possible to change the action="" property of a form on the fly using JavaScript?Basically something similar to:[code]onmouseover="this.classname='css'"[/code]...but for action! :PThanks! Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted October 11, 2006 Share Posted October 11, 2006 Yes. Give your form a name by adding the name="my_form_name" attribute to the form tag then use use the following javascript:document.my_form_name.action='new action here' Quote Link to comment Share on other sites More sharing options...
obsidian Posted October 11, 2006 Share Posted October 11, 2006 or, if you want to use a mouseover function like you're referencing, you can attach this to the element within the form:[code]onmouseover="this.form.action='post';"[/code] Quote Link to comment Share on other sites More sharing options...
shiny_spoon Posted October 11, 2006 Author Share Posted October 11, 2006 Thank you both very much! ;D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.