By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,643 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

Validation for gender(radiobutton list)

P: 19
if (Gender === "") {
var bCheck = false;
for (var i = 0; i < Gender.length; i++) {
if (Gender[i].checked) {
bCheck = true;
}
}

if (bCheck === false) {
document.getElementById("Tabs_Panel3_Label3").inne rText = "Please select Gender ";
document.getElementById("Tabs_Panel3_Label3").styl e.display = "block";
return false;
}
}

return true;
}





Thanks in advance:)
Jul 27 '16 #1
Share this Question
Share on Google+
4 Replies


P: 4
Line 2: Missing semicolon.
Line 2: Expected an assignment or function call and instead saw an expression.
Line 3: Use '===' to compare with ''.
Line 11: Use '===' to compare with 'false'.
Line 12: Expected an assignment or function call and instead saw an expression.
Line 12: Missing semicolon.
Line 13: Expected an assignment or function call and instead saw an expression.
Line 13: Missing semicolon.
Line 19: Expected '(end)' and instead saw '}'.
Jul 27 '16 #2

Dormilich
Expert Mod 5K+
P: 8,639
Gender is a string ...

... and the condition makes no sense at all.
Jul 27 '16 #3

P: 19
Thanks Dormilich and HargreavesRandy,my problems were solved.:)
Jul 28 '16 #4

P: 19
how to set the cursor postion in textbox
Jul 28 '16 #5

Post your reply

Sign in to post your reply or Sign up for a free account.