Subject: Thanks, Andrew. Good stuff, BUT …
I do have some javascript date validation code in place (posted below), but the error occurs before my javascipt validation code runs. Maybe I need to move the code to a different trigger/event.
Simple description of my problem:
I have a test form with two fields. One is a date field, the other is a radio button field with ‘refresh fields on keyword change’.
If I enter junk into the date field, then change the radio button value, the web form tries to refresh, but instead goes away completely and displays a generic message:
The website cannot display the page. HTTP 500. Most likely causes:
The website is under maintenance.
The website has a programming error.
In my opinion, this is horrible default behaviour by Domino. In my real life app, this means all of the user’s input is blown away.
Here is a code snippit of the date validation I have in place, triggered to run when someone submits a form:
//FlightDepartureDate required if Flight booking type - also make sure it is valid.
if(document.forms[0].FlightDepartureDate){
if((document.forms[0].FlightDepartureDate.value.length < 1 | validateDate(document.forms[0].FlightDepartureDate, 'Flight Departure date') == false ) & document.forms[0].BookingTypeIncludesFlight.value.length > 2 ){
msg +="\r - Flight Departure Date";
msgflag="true";
if(gotofield == ""){
document.forms[0].FlightDepartureDate.focus();
gotofield="FlightDepartureDate";
}
}
}
/*********************************************************
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 date for " + errMsg + “.”);
fld.focus();
return false;
}
return true;
}