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

How to display messages as soon as the checkbox is checked ...

Status
Not open for further replies.

request

Programmer
Dec 5, 2001
76
US
I have a checkbox defined as follows on a form:

<form name=&quot;form1&quot; action=&quot;act_MList.cfm&quot; method=&quot;post&quot;
<td><input type=&quot;Checkbox&quot; name=&quot;Request&quot; value=&quot;#orderid#&quot; align=&quot;right&quot; onclick=&quot;checkAvailability()&quot;></td>
</form>

How can I code the function checkAvailability so that as soon as a user checks the checkbox, a message should pop up &quot;Are you sure you want to order&quot;.

Please help. Thanks.
 
Javscript:
<script>
function checkAvailability(){
if (document.form1.Request.checked){
document.form1.Request.checked=true;
alert(&quot;Are you sure you want to order&quot;);
return false;
}
else {
document.form1.Request.checked=false;

}
}
</script>

<input type=&quot;Checkbox&quot; name=&quot;Request&quot; value=&quot;#orderid#&quot; align=&quot;right&quot; onclick=&quot;checkAvailability()&quot;>

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