Hi good evening,
In a page I show a list of students with checkboxes dynamically and one message box.
When the user submit if no checkboxes (atleast one check box) selected, I want to show one alert meassage like "Please select atleast one student";
I did in javascript like this , but it is not working for me. What and how to do this next?
I validate this checkboxes while on submit the form.
function showlist()
{
var a = document.getElementById('student').value;
if(a.length < 1)
{
alert("Please Select Atleast one student");
document.getElementById('student').focus();
return false;
}
}
AntonyRayan 15 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.