I have an HTML form that uses a PHP file in the form tag action="" for sending the content of the form as an email.
I have a simple JavaScript for required fields that is called for in the form tag onsubmit="".
My PHP file returns a summary of the form after it is submitted.
All I need to add is a simple confirmation dialog box. But I'm having trouble figuring out how to do that. (Sorry, I should be a little more brilliant!) I could probably add JavaScript to my required fields code, but not sure how to do that. Here is my existing code:
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{
alert(alerttxt);return false;
}
else
{
return true;
}
}
}
function validate_form(thisform)
{
with (thisform)
{
if (validate_required(drop_point,"Please choose a Drop Point")==false)
{drop_point.focus();return false;}
if (validate_required(your_name,"Please enter your Name")==false)
{your_name.focus();return false;}
if (validate_required(email,"Please enter your Email Address")==false)
{your_name.focus();return false;}
}
}
Any help would be appreciated! Thanks!