Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending variable with form Action with a get method

Status
Not open for further replies.

mtawk

Programmer
Nov 6, 2001
26
IQ
here is my code:
<form action=&quot;file.html?myvar=xxx&quot; method=&quot;GET&quot; name=&quot;myform&quot; >
<INPUT TYPE=&quot;text&quot; name=&quot;myinput&quot; value=&quot;yyy&quot;>
<input type=&quot;submit&quot; name=&quot;submitForm&quot; value = &quot;submit&quot;>
</form>

my problem is i'm using netscape so i need the method get to get the variables, and the result i'm getting is overwriting the variable i'm sending with my form action
so i'm getting as a result after the form submit :
file.html?myinput=yyy
and myvar=xxx is lost

thanks for any help
 
mtawk,
i would send the variable as a hidden form field, so it would b included with the rest of the form variables sent.

ex:

<form action=&quot;file.html&quot; method=&quot;GET&quot; name=&quot;myform&quot; >
<INPUT TYPE=&quot;text&quot; name=&quot;myinput&quot; value=&quot;yyy&quot;>
<INPUT TYPE=&quot;hidden&quot; name=&quot;myvar&quot; value=&quot;xxx&quot;>
<input type=&quot;submit&quot; name=&quot;submitForm&quot; value = &quot;submit&quot;>
</form>

which should give you:

file.html?myinput=yyy&myvar=xxx



~ jsLove
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top