HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 24th, 2000, 03:12 PM
jp1878 jp1878 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 3 jp1878 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I need a form that the first field is a drop-down box specifying which page the form will submit to, and two other text fields to be submitted to that page.

So far, I can get the first problem to work using: "location = '' + document.navform.inchoice.options[ document.navform.inchoice.selectedIndex ].value"

But the data from the second and third fields doesnt flow thru to the page intended.

Please Help!

Thanks,
Josh

Reply With Quote
  #2  
Old October 24th, 2000, 06:42 PM
velvEtY velvEtY is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 7 velvEtY User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
you cant really have the action of the form (where it will submit to) as a dynamic variable. IT has to be set. You CAN however, submit your form to a 'middle' page that will process the data and then redirect to the page you selected in the list.

so have the first form submit to a processing page that will stick the form vbariables you selected into another form as hidden inputs, and have the form action equal to the page you selected from the drop down list.

OR you could a javascript to do it all for you like this:

<form name="myformname">
<input type="text" name="myFormText1">
<input type="text" name="myFormText2">

<select name="page" onSelect="location.href = document.myformname.page.value + '?myFormText1=' + document.myformname.myFormText1.value + '&myFormText2=' + document.myformname.myFormText2.value ;">

<option value="page1.html">page1</option>
....
</form>

WHen you select a choice from the dropdown selection..it will relocate you to the page you selected and add the 2 textfeilds to the query string that it sends to the page.

FOr instance, if you select option 1 of the drop down, you will go to
page1.html?myformText1=_____&myFormText2=_____

where ___ are the values you entered in the text fields.




[This message has been edited by velvEtY (edited October 24, 2000).]

Reply With Quote
  #3  
Old October 24th, 2000, 07:20 PM
jp1878 jp1878 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 3 jp1878 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by velvEtY:
you cant really have the action of the form (where it will submit to) as a dynamic variable. IT has to be set. You CAN however, submit your form to a 'middle' page that will process the data and then redirect to the page you selected in the list.

so have the first form submit to a processing page that will stick the form vbariables you selected into another form as hidden inputs, and have the form action equal to the page you selected from the drop down list.

OR you could a javascript to do it all for you like this:

<form name="myformname">
<input type="text" name="myFormText1">
<input type="text" name="myFormText2">

<select name="page" onSelect="location.href = document.myformname.page.value + '?myFormText1=' + document.myformname.myFormText1.value + '&myFormText2=' + document.myformname.myFormText2.value ;">

<option value="page1.html">page1</option>
....
</form>

WHen you select a choice from the dropdown selection..it will relocate you to the page you selected and add the 2 textfeilds to the query string that it sends to the page.

FOr instance, if you select option 1 of the drop down, you will go to
page1.html?myformText1=_____&myFormText2=_____

where ___ are the values you entered in the text fields.


[This message has been edited by velvEtY (edited October 24, 2000).]
[/quote]

Well, I can already make it post to the page selected in the drop down box, but I can not get the text fields to post to that page.....

Maybe I'm just confused!!!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Form Field Trouble


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT