[jQuery] Re: Change form action based on button clicked
View this page http://www.komodomedia.com/blog/2008/07/using-jquery-to-save-form-details/ On 12 Jun, 15:25, ciupaz luigi.zambe...@gmail.com wrote: Hi all, I have a form like this: form id=my_form method=post action= Name: br / input type=text id=name name=name / input type=submit id=submit1 value=Go to page 1 / input type=submit id=submit2 value=Go to page 2 / /form how can I change my action form so the form goes to Page1.htm with click on button1 and goes to Page2.htm to click on button2, and mantein the value inserted in textbox name? Thanks a lot. Luis
[jQuery] Re: Change form action based on button clicked
function go(button) { $(#my_form).attr(action,button.value); } and then in your button tag add this onclick='go(this)' cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: ciupaz luigi.zambe...@gmail.com To: jQuery (English) jquery-en@googlegroups.com Date: 06/12/2009 10:27 AM Subject:[jQuery] Change form action based on button clicked Hi all, I have a form like this: form id=my_form method=post action= Name: br / input type=text id=name name=name / input type=submit id=submit1 value=Go to page 1 / input type=submit id=submit2 value=Go to page 2 / /form how can I change my action form so the form goes to Page1.htm with click on button1 and goes to Page2.htm to click on button2, and mantein the value inserted in textbox name? Thanks a lot. Luis inline: graycol.gifinline: ecblank.gif
[jQuery] Re: Change form action based on button clicked
Thanks, it's work, and how can I recover the input text value, without using the querystring? Luis
[jQuery] Re: Change form action based on button clicked
Cookies?! See the link i've posted above! On 12 Jun, 15:48, ciupaz luigi.zambe...@gmail.com wrote: Thanks, it's work, and how can I recover the input text value, without using the querystring? Luis