|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I've got a page with a form with the usual action="action.php3" clause. But I want the form to go somewhere else if one of the fields has changed. Can this be done?
|
|
#2
|
|||
|
|||
|
not sure if I completely understand you, but you want to branch depending on the input from one or more forms, right?
In PHP I use a dispatch routine to accomplish this. Let's say I have 15 pages and a central dispatcher called mysite.php3. mysite.php3 will take the form of a large multicase if statement which requires or includes the appropriate form based on the value of the submit button. (but you could use any field). Alternatively, I believe you can set document.myform.action="whatever you want to do" in your javascript code using onchange as a trigger in every input field. |
|
#3
|
|||
|
|||
|
Thanks micky - it's the javascript solution that I need.
|
|
#4
|
|||
|
|||
|
You can write a function something like this:
function ChangeTarget(){ document.form_name.target="target.php3"; } and then call this function from the onchange event of whichever input element you need to. Hope that helps, Matt. <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by RedEyes: I've got a page with a form with the usual action="action.php3" clause. But I want the form to go somewhere else if one of the fields has changed. Can this be done?[/quote] |
|
#5
|
|||
|
|||
|
Sorry! Above function should read-
document.form_name.action="action.php3"; Matt. <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by RedEyes: I've got a page with a form with the usual action="action.php3" clause. But I want the form to go somewhere else if one of the fields has changed. Can this be done?[/quote] |
|
#6
|
|||
|
|||
|
That's just what I need. Thanks for your help guys.
|
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Dynamic Submit Pages |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|