simply adding form selection values

admin

Administrator
Staff member
it keeps returning 15, i would like it to add the option values... please help. also to include an alert if nothing is selected, i tried doing this think that if nothing is selected then ada must = 0 so alert user to select. thanks ;)

<html><head>
<script language="JavaScript"><!--

function AddRadioButtons () {

var itemchecked = false;
var ada = 0;

var ada = parseFloat(document.form.ada1.value)+parseFloat (document.form.a2.value)+parseFloat (document.form.a3.value)+parseFloat (document.form.a4.value)+parseFloat (document.form.a5.value)+parseFloat (document.form.a6.value)+parseFloat (document.form.a7.value);

if(ada>15) {
ada = 15;
} else {
if ada= 0 {
alert("Please select an Education Level");
}
}

document.write (ada)

}
//--></script>

</head><body><form name="form">

<input type="radio" value=http://www.webdeveloper.com/forum/archive/index.php/"5" name="a1">
<input type="radio" value="7" name="a2">
<input type="radio" value="9" name="a3">
<input type="radio" value="12" name="a4">
<input type="radio" value="12" name="a5">
<input type="radio" value="12" name="a6">
<input type="radio" value="12" name="a7">
<input type="Submit" value="Next" onclick="AddRadioButtons();"/>

</form></body></html>
 
Back
Top