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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

retrieving form values using type=file

Status
Not open for further replies.

randm

Programmer
May 15, 2003
1
0
0
CA
Hello, I would like to know how to return the value of a field inside a form tag so I can pass it as a query string on the action attribute by using only VBS. For example:

<form name=&quot;form1&quot; action=&quot;someasp.asp?IwantThis=<%=document.form1.who.value%>&quot;>
<input name=&quot;who&quot; type=text>
<input name=&quot;file&quot; type=file value=&quot;file&quot;>
<input name=&quot;submit&quot; type=submit value=&quot;submit&quot;>
</form>

Thanks a million.

 
If you are posting the form, create a function for the onsubmit event of the form. Example:
<HTML>
<HEAD>
<TITLE>Test Page</TITLE>
<SCRIPT language=&quot;VBScript&quot;>
Function AddParam()
form1.action = &quot;someasp.asp?IwantThis=&quot; & form1.who.value
End Function
</SCRIPT>
</HEAD>
<BODY>
<form name=&quot;form1&quot; action=&quot;someasp.asp&quot; method=&quot;post&quot; onsubmit=&quot;vbscript:AddParam()&quot;>
<input name=&quot;who&quot; type=text>
<input name=&quot;file&quot; type=file value=&quot;file&quot;>
<input name=&quot;submit&quot; type=submit value=&quot;submit&quot;>
</form>
</BODY>
</HTML>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top