Metachecker.net
|
TrafficChecker.net
|
RankChecker.net
Learn Java Script Today
|
Over 5000 Free Fonts
|
Tutorials
|
Javascript Forum
|
Other Javascript Resources
|
Cheat Sheet
JavaScript Basics
Inserting Javascript
Complete Tutorial
Advance DHTML Tutorial
Script archive
Advanced Tutorials
Alert Scripts
Animation
Audio
Background Effects
Banner Ads
Browser Window
Buttons
Button Forms
Calculcators
Calendars
Clocks & Dates
Cookies
Cursor Effects
DHMTL Games
DHTML Miscellaneous
Equivalents
Forms
Games
IE4+ Scripts
IE5+ Scripts
Image Effects
Image Miscellaneous
Links & Buttons
Math Related
Messages Miscellaneous
Miscellaneous
Mouse Tricks
Navigation
Page Details
Password Protection
Pulldown Menus
Random Stuff
Scrolling
Status Bar
Text Animation
User Detail
User Info
Window Control
Validation (Selection)
Use Javascript to ensure that visitors choose both a radio button and a checkbox. Invalid submissions are cancelled.
MENU
RADIOS
--- How many times have you been to TJS? ---
Once
Twice
Three times
Four times
Five times
Six times
Seven times
Eight times
Nine times
Ten+ times
Will you be back to TJS?
YES
NO
MAYBE
MENU:
RADIO:
Insert into <HEAD>
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin var menu_selection=""; var radio_selection=""; function checkForm() { if (dropDownMenu() && radioButtons()) { document.forms[0].results1.value=menu_selection; document.forms[0].results2.value=radio_selection; alert("\nForm has been filled out correctly."); } } function dropDownMenu(form) { var myindex=document.forms[0].menu.selectedIndex; if (myindex==0) { alert("\nYou must make a selection from the drop-down menu."); document.forms[0].menu.focus(); } else { menu_selection=document.forms[0].menu.options[myindex].value; return true; } } function radioButtons() { if (radio_selection=="") alert("\nYou must check one of the radio buttons."); else { return true; } } function resetForm() { document.forms[0].menu.options[0].selected = true; menu_selection=""; radio_selection=""; } function about() { alert("\nVALIDATOR checks to see that a selection has been made from the drop-down menu and that a radio button has been checked.\n\nIf filled out properly, the data will be displayed below."); } // End --> </SCRIPT>
Insert into <BODY>
<CENTER> <FORM> <TABLE BORDER=4 WIDTH=500> <TR> <TD align="center"><FONT SIZE=+1><B>MENU</B></FONT> <TD align="center"><FONT SIZE=+1><B>RADIOS</B></FONT> </TR> <TR> <TD align="center"><SELECT NAME="menu" SIZE=1> <OPTION SELECTED VALUE=""> --- How many times have you been to TJS? --- <OPTION VALUE="one">Once <OPTION VALUE="two">Twice <OPTION VALUE="three">Three times <OPTION VALUE="four">Four times <OPTION VALUE="five">Five times <OPTION VALUE="six">Six times <OPTION VALUE="seven">Seven times <OPTION VALUE="eight">Eight times <OPTION VALUE="nine">Nine times <OPTION VALUE="ten">Ten+ times </SELECT> <TD align="center"><BR>Will you be back to TJS?<br> <INPUT TYPE="radio" NAME="radiobutton" onClick="radio_selection='yes'">YES <INPUT TYPE="radio" NAME="radiobutton" onClick="radio_selection='no'">NO <INPUT TYPE="radio" NAME="radiobutton" onClick="radio_selection='maybe'">MAYBE </TR> </TABLE> <BR> <TABLE BORDER=0 WIDTH=400> <TD align="center"><INPUT TYPE="reset" VALUE="Reset" onClick="resetForm()"> <TD align="center"><INPUT TYPE="button" VALUE="Check Form Fields" onClick="checkForm()"> <TD align="center"><INPUT TYPE="button" VALUE="About" onClick="about()"> </TABLE> <BR> <TABLE BORDER=4 WIDTH=250> <TR> <TD align="center">MENU: <TD align="center">RADIO: </TR> <TR> <TD align="center"><INPUT TYPE="text" NAME="results1" SIZE=7> <TD align="center"><INPUT TYPE="text" NAME="results2" SIZE=7> </TR> </TABLE> <BR> </FORM> </CENTER>
Other Options