For a simple form with an alert that asks if fields were filled out correctly, I need a function that does this:
Shows an alert box when button is clicked w
If you want to apply some condition on form submit then you can use this method
One thing always keep in mind that method and action attribute write after onsubmit attributes
javascript code
function checkEmpData()
{
var a = 0;
if(a != 0)
{
return confirm("Do you want to generate attendance?");
}
else
{
alert('Please Select Employee First');
return false;
}
}