1

This is what I'm using.

It's great. I only need to add function that checks if one of "cp", "bp", "hp" input area is entered or not. If not it should give an error that says "Please enter at least 1 phone number."

(cp = cell phone, bp = business phone, hp = home phone)

4
  • Advance is a verb. Advanced is an adjective. Commented Jan 11, 2012 at 18:29
  • 1
    function DoCustomValidation() { var frm = document.forms["myform"]; if(!frm.cp.value && !frm.bp.value && !frm.hp.value &&) { sfm_show_error_msg('The Password and verified password does not match!',frm.pwd1); return false; } else { return true; } } Commented Jan 11, 2012 at 18:29
  • 1
    That is what I tried, is that enough for you ? Commented Jan 11, 2012 at 18:30
  • @Extelliqent - Can you include that code in your question, with formatting? Commented Jan 11, 2012 at 18:32

1 Answer 1

1
function checkPhones(){
  var frm = document.forms["myform"];
  var cell = frm.cp.val;
  var bus = frm.bp.val;
  var home = frm.hp.val;
  if(ValidatePhone(cell) || ValidatePhone(bus) || ValidatePhone(home)){
  return true;
}
return false;
}

function ValidatePhone(val){
//insert code to check phone meets your system requirements
//either length or pattern
//return true or false
}


frmvalidator.setAddnlValidationFunction("checkPhones");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.