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

Passing parameters to function.

Status
Not open for further replies.

EdRev

Programmer
Aug 29, 2000
510
US
On the code below, I have four button that will execute the onsubmit function. What parameter will I pass to the onsubmit function. Depending on the parameter that each button will pass, the onSubmit function will display different messages. Also, I want a message that will prompt the user to proceed or cancel, how do I do that?

<HTML>
<HEAD>
</HEAD>

<Script language=&quot;Javascript&quot;>


function cmdSubmit(thisForm)
{
ver=thisForm.wkce.value
if (ver ==&quot;wkce&quot;)
{
alert(&quot;Consolidate WKCE.Do you want to proceed?&quot;)
}


}

</Script>

<BODY bgcolor=&quot;white&quot;>
<center>
<P> </p>
<h2>Click Version</h2>
<FORM name=thisForm METHOD=post>
<P> </p>
<input type = image src=<%=bce%> onclick=&quot;cmdSubmit(thisForm)&quot;>
<input type = image src=<%=bbp%> onclick=&quot;cmdSubmit(thisForm)&quot;>
<input type = image src=<%=bny%> onclick=&quot;cmdSubmit(thisForm)&quot;>
<input type = image src=<%=bae%> onclick=&quot;cmdSubmit(thisForm)&quot;>
</BODY>
</FORM>



 
The second part I beleive (not 100%) should be:
<Script language=&quot;Javascript&quot;>


function cmdSubmit(thisForm)
{
ver=thisForm.wkce.value
if (ver ==&quot;wkce&quot;)
{
confirm(&quot;Consolidate WKCE.Do you want to proceed?&quot;)
}


}

</Script>
DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top