JavaScript Forum JS Made Easy: Free JavaScripts Tutorials Example Code
About This Product
FontsMadeEasy.com
 
The Business Internet
Find it on This page:
 
| Over 5000 Free Fonts | Tutorials | Javascript Forum | Other Javascript Resources | Cheat Sheet

     
Jsmadeeasy Forums Home   Search   Login   Register   Member List  
JS Made Easy  > JavaScript programming  > Re:  
 
Display using:  
Previous Thread :: Next Thread 
 Author Thread: Form action access with a Script
hlehr is not online. Last active: 7/28/2004 3:52:08 PM hlehr
www.airlinedispatch.com
Top 100 Poster
Joined: 28 Jul 2004
Total Posts: 2
 
Form action access with a Script
Posted: 22 Feb 2002 09:58 AM
Hi all,
just knew in the community I've got the need to access a form action property from a script.
Basically it means, I do have a form with 3 options and like the form action http to change depending in the option selection.
In addition the form has a text field which should be submitted when pressing the submit button. (The web pages I need to send the form input field to are having different adresses.)

I tried it with

var URL = document.select.site.options[document.select.site.selectedIndex].value;
form.action = URL;

but it didn't fire the form.

Any ideas about how to do this, everything welcome.

Helmut

Helmut Lehr

Helmut Lehr
Admin is not online. Last active: 12/1/2005 12:27:12 PM Admin
Top 25 Poster
Forum Moderator
Joined: 28 Jul 2004
Total Posts: 15
 
Re:
Posted: 22 Feb 2002 09:40 PM
change this
form.action = URL;
to
document.frmName.submit


or you can try this:

document.location = URL

hope this helps


hlehr is not online. Last active: 7/28/2004 3:52:08 PM hlehr
www.airlinedispatch.com
Top 100 Poster
Joined: 28 Jul 2004
Total Posts: 2
 
Re:
Posted: 23 Feb 2002 12:04 AM
Thanks a lot,

with Your input i could work it out and it goes like this

document.frmName.action = URL

without specifying any action= in the form field. Just put an onclick= event to the button.

Brgds

Helmut

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
change this
form.action = URL;
to
document.frmName.submit


or you can try this:

document.location = URL

hope this helps



<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Helmut Lehr

Helmut Lehr
Previous Thread :: Next Thread 
Goto to page:  Prev Next
 
Jsmadeeasy.com  > JS Made Easy  > JavaScript programming  > Re: