Save Button with Confirmation (Javascript):   Return to List

' Button:
<input type="button" name="btnSaveChanges" value="SAVE CHANGES"
    onClick="javascript:ValidateEntriesAndSubmit(this.form)">

' Function:
<script language="javascript">
/* **************************************
Some browser-side validation shown below -- along with obtaining
possible email recipient from the User.
**************************************** */
function ValidateEntriesAndSubmit(form, status)
{
    // **** Validates date against IsDate() function in CarlRoutines.asp *****
    if (IsDate(form.x_dtGenl_Date_Reported.value) == false)
    {
        form.x_dtGenl_Date_Reported.focus();
        alert("Date Reported is NOT a valid date! Suggest you use date picker (next to textbox) and correct.");
        return false;
    }
    // ***** etc. etc. //
    form.submit();
}



Note to Webmaster