Hi All,
I have a Form Submit button , and when you click the submit button, it does some field validations and submits the form (that actually runs a Lotus Script agent on the web Query save event.
My validations don’t work
Here is a function to validate the date (and I call this function in Submit Button as below
validateDate()
This function checks to make sure the user has entered
a date.
Arguments:
fld = field
errMsg = english name of field for display on error
**********************************************************/
function validateDate(fld, errMsg)
{
var stDate = new Date(fld.value);
if (stDate == "NaN")
{
alert("Please enter a valid " + errMsg + ".");
fld.focus();
return false;
}
return true;
}//endfunction validateDate
My Submit has code as below on web client
var f = document.forms[0];
if (validateRadio(f.EntryType, “EntryType”) == false)
return false;
elseif (validateDate(f.Startdate, “Startdate”) == false)
return false;
elseif (validateDate(f.EndDate, “EndDate”) == false)
return false;
return true;
if (confirm("Are you ready to submit this form now?"))
{
f.Action.value = "Submit"
f.submit();
}
The problem is it is working and validating fine till startdate, but when it ciomes to End Date nothing happens if the field is blank , it should alert me , but giving me a JavaScript error
Object expected
URL: http://localhost/Databsename.nsf/Appointment?openform&Seq=1
Please help,
Thanks in advance,
ac ac