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

Calling a script from a control

Status
Not open for further replies.

JackD4ME

Programmer
Jun 4, 2002
228
US
I have a script that has an if statement to call requested asp. I want to call the script through a control button. I am unsure of how to do this. The code I have does not work, it is below. Can anyone help.
Thanks.

<FORM name=&quot;OilInq&quot; method=&quot;post&quot; onclick=callAsp><B>Search:</B>&nbsp;
<SELECT name=&quot;Category&quot;>
<OPTION value=&quot;IntPIN&quot;>Int PIN</OPTION>
<OPTION value=&quot;Lease&quot;>Lease</OPTION>
<OPTION value=&quot;Operator&quot;>Operator</OPTION>
<OPTION value=&quot;Unit&quot;>Unit</OPTION>
</SELECT>
Enter ID:
<BR><INPUT type=text name=&quot;ID&quot; size=8><p>
<INPUT type=submit value=&quot;Search&quot; size=8>
</FORM>
 
try this
<FORM name=&quot;OilInq&quot; method=&quot;post&quot; action=&quot; &quot;>
<INPUT type=submit value=&quot;Search&quot; size=8 onSubmit=&quot;callAsp()&quot;>


I'm asuming that whatever callASP is a sub or function on the page the form is.

If it is another script like callASP.asp then you need a action which I stated in the form tag to call it. put it in like this
action=&quot;callASP.asp&quot; I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
 
one other thing. If callASP is two words, which I'm sure it is you only need to write the name of the sub/function not call in onSubmit

ei
onSubmit=&quot;sub()&quot;>

hope that helps I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top