PDA

View Full Version : Changing form action with a dropdown


kkroo
04-10-2006, 08:43 PM
I have a form, and i would like the user to be able to submit it to different servers by selecting a option from a <select> menu and it would change the value of the action page in <form> without reloading the page

so i think it would be something like this

<form action=javascript:action; >

Thanks in advance!

ddadmin
04-10-2006, 10:40 PM
Something like the below select menu should do it:

<select size="1" onChange="this.form.action=this.options[this.selectedIndex].value;">
<option value="default.php">Select action</option>
<option value="bob.php">Bob</option>
<option value="joe.php">Joe</option>
</select>

kkroo
04-11-2006, 11:00 AM
Thank you soooo much, that is exactly what i want! Thanks!!!!!!