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

Submitting A Form

Status
Not open for further replies.

GDX

Programmer
Jun 4, 2000
186
US
Hello Guys,

I am trying to submit a form but only when the variable bSrch is equal to 1, bascially the whole idea is the client has to click on the button before they can click the image (which submits the form) so what i do is when the form loads i make bSrch = 0 and when they click the search button i make bSrch = 1, and now when they goto click the image (which submits the form) i check to see if equals 1, simple enough right? Well everything works but it doesnt submit the form, I replaced the test.submit code with alert9('Hi') to see if it does get through and it does, but my form just wont submit! nothing happens, please shed some light on this situation for me please, Thanks....


Code:


<body onLoad = &quot;bSrch=0;&quot;>
<form name=&quot;search&quot;>
<input type=&quot;text&quot; name=&quot;srchtxt&quot;>
<input type=&quot;button&quot; onClick= &quot;bSrch = 1;window.test.imgr.src='../images/featured.gif'&quot;>
</form>
<form name=&quot;test&quot; action=&quot;Clears.asp&quot; method=&quot;post&quot;>
<input type=&quot;text&quot; name=&quot;txtfld&quot; value=&quot;Test Value&quot;>
<a href=&quot;javascript: void(0);&quot; onClick=&quot;if (bSrch == 1) test.submit;&quot;><img src=&quot;../images/crm.gif&quot; name=&quot;imgr&quot;></a>
</form> Gordon R. Durgha
gd@vslink.net
 
try this
<body onLoad = &quot;bSrch=0;&quot;>
<form name=&quot;search&quot;>
<input type=&quot;text&quot; name=&quot;srchtxt&quot;>
<input type=&quot;button&quot; value=&quot;Click&quot; onClick= &quot;bSrch = 1;window.test.imgr.src='partner.gif'&quot;>
</form>
<form name=&quot;test&quot; action=&quot;Clears.asp&quot; method=&quot;post&quot;>
<input type=&quot;text&quot; name=&quot;txtfld&quot; value=&quot;Test Value&quot;>
<a href=&quot;clearsNew.asp&quot; onClick=&quot;if (bSrch == 1) test.submit();return false&quot; ><img src=&quot;&quot; name=&quot;imgr&quot;></a>
</form>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top