Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Java script example: button requiring checkbox to be che
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows Server 2003
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01087958
Message ID:
01088117
Views:
11
>Does anyone have an example of some java script that, on the click of a html form button, checks that a checkbox on the page is in fact checked before action is taken on the button submit?
>
>Something like:
>
>'x' I have read and agree to the policy
>
>
Here is a "cheap" way. But a radio button may also be a good preference
<HTML><HEAD><script type="text/javascript" language="JavaScript">
function runSetCheck()
{
theform.theCheck.value="X";
}
</script>
</head>
<body>
<form name="theform">
<H4>Click to Check the Check</H4>
<table align="left" border=".1" >
<tr><th align="left" width="100">Click to Check.</tr>
<td width = "2"><input type="button" value="Set the Check" name="doSetCheck" language="JavaScript"
onclick="runSetCheck();"><td width = "10">theCheck<input type="text" align="bottom" name="theCheck" value="" size="10" ></td></td></tr>
</form>
</body>
</html>
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform