Hi Steve,
below is the function - it works perfectly when it's called, and the
behaviour I've been talking about happens with *all* of my functions,
and also on the pages that don't even call a function on submit...
function checkClientInfoSubmit() {
theForm = document.clientInfoForm;
/* make sure at least one client type is checked */
// default the boolean to false
var bChecked = false;
// default the submit boolean to false
var bDoSubmit = true;
// loop through the checkboxes.
for (var i = 0; i < theForm.temp_client_type_id.length; i++)
{
// if we find one that's checked...
if (theForm.temp_client_type_id[i].checked)
{
bChecked = true;
break;
}
}
// if nothing was checked...
if (!bChecked) {
alert("Please select at least one Client Type");
bDoSubmit = false;
}
/* check for first name and last name */
if ( theForm.first_name.value == "" || theForm.last_name.value == "" ) {
alert("Please enter the client's full name");
bDoSubmit = false;
}
/* check for home phone */
if ( theForm.home_phone.value == "") {
alert("Please enter the client's home phone number");
bDoSubmit = false;
}
/* check for street number */
if ( theForm.street_number.value == "") {
alert("Please enter the client's street number");
bDoSubmit = false;
}
/* check for street */
if ( theForm.street.value == "") {
alert("Please enter the client's street name");
bDoSubmit = false;
}
/* check for city */
if ( theForm.city.value == "") {
alert("Please enter the client's city");
bDoSubmit = false;
}
/* check for suburb, state and postcode */
if ( theForm.suburb.value == "" || theForm.state.value == "" ||
theForm.postcode.value == "") {
alert("Please enter the client's Suburb, State and postcode");
bDoSubmit = false;
}
/* check for solicitor */
if ( theForm.solicitor_id.options[theForm.solicitor_id.selectedIndex].value ==
"" && (theForm.first_name_sol.value != "" || theForm.last_name_sol.value != "" ||
theForm.work_phone_sol.value != "" || theForm.street_number_sol.value != "" ||
theForm.street_sol.value != "" || theForm.city_sol.value != "" ||
theForm.suburb_sol.value != "")) {
/* check for first name and last name */
if ( theForm.first_name_sol.value == "" || theForm.last_name_sol.value
== "" ) {
alert("Please enter the solicitor's full name");
bDoSubmit = false;
}
/* check for home phone */
if ( theForm.work_phone_sol.value == "") {
alert("Please enter the solicitor's home phone number");
bDoSubmit = false;
}
/* check for street number */
if ( theForm.street_number_sol.value == "") {
alert("Please enter the solicitor's street number");
bDoSubmit = false;
}
/* check for street */
if ( theForm.street_sol.value == "") {
alert("Please enter the solicitor's street name");
bDoSubmit = false;
}
/* check for city */
if ( theForm.city_sol.value == "") {
alert("Please enter the solicitor's city");
bDoSubmit = false;
}
/* check for suburb, state and postcode */
if ( theForm.suburb_sol.value == "" || theForm.state_sol.value == ""
|| theForm.postcode_sol.value == "") {
alert("Please enter the solicitor's Suburb, State and
postcode");
bDoSubmit = false;
}
}
if (bDoSubmit) {
theForm.submit();
} else {
return false;
}
}
Friday, October 3, 2003, 12:08:37 PM, you wrote:
SO> Next step
SO> show us your checkClientInfo() function
--------------------------------
Life is Poetry,
write it in your own words
--------------------------------
Toby Tremayne
Cold Fusion Developer
Code Poet and Zen Master of the Heavy Sleep
Virtual Tours
+61 416 048 090
ICQ: 13107913
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/