[Javascript] making form ACTION a variable

Eligio Morgado eligio at gmail.com
Sat Jan 29 19:32:52 CST 2005


Hi.

This is my first mail to the list, so first here is my presentation.


The answer is yes, you can do it. As simple as:

document.forms["your_form_name"].action = ( your_condition) ?
"yes.php" : "no.php";
document.forms["your_form_name"].submit( );



Eligio Morgado.


On Sat, 29 Jan 2005 16:23:06 -0800, Steven Pesant <spesant at telus.net> wrote:
>  Hello,
> 
>  I've got a series of integrated forms on website that have been running
> successfully for some time.  However, I now need to add a couple of special
> steps, that rather than rebuilding all the forms; would prefer to have a
> drop in sequence that I can use when and where required.
> 
>  For example, I am trying to make the value of the <FORM ACTION ="">
> elements be different depending on specific values entered into a form.
> 
>  
>  Concept:
> 
>  If answer to Question1 = "YES"
>          then the <FORM ACTION="yes.php">
>  if answer to Question2 = "NO"
>          then the <FORM ACTION="no.php">
> 
>  
>  Thanks for any pointers.
> 
>  
>  
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> 
>



More information about the Javascript mailing list