Javascript onsubmit with cgi action?

samo_bs

New Member
I have a html form and have a cgi script running on the action and then I have a javascript onsubmit function that should check if the radio button was filled out otherwise it wont submit.\[code\]<script>function checkscript(){ .... check if a radio button was clicked otherwise dont submit. }</script><form action="default.cgi" method="post" onsubmit="return checkscript()" enctype="application/x-www-form-urlencoded"><h1>Choose</h1><p><input type="radio" name="Radio" value="http://stackoverflow.com/questions/15754296/1" /><font size="5"color="#0033CC">Instant Psychology</font><br /><br /><input type="radio" name="Radio" value="http://stackoverflow.com/questions/15754296/2" /><font size="5"color="#CC0000">Instant Geography</font><br /><br /><form/>\[/code\]Can I do this in a Javascript function in the html file or do I need to do that in the cgi script?
 
Back
Top