// This method is called when form is submitted
setMSISDNEmailAddressValidateForm = function() {

    
	if(regForm2 = document.getElementById("RegistrationFormBean")){

		regForm2.onsubmit = validateField;
	}

}



function validateField()
{
 
	var regForm2 = document.getElementById("RegistrationFormBean");

	//message variable holds represents the message dispalyed in case of validation faliure
    var message='';
    
    //counter for checking if some validation has failed
    var ctr=0;
 
    var msisdn = document.getElementById(getNetuiTagName('phone_number')).value;
    
    // alert('msisdn = ' + msisdn);
    
    var email = document.getElementById(getNetuiTagName('email_address')).value;
    
    // alert('email = ' + email);
    
    if(msisdn==null)
    {
       if(msisdn =="")
       {
		if(email==null)
        {
         if(email =="")
          {
			    message += 'Please enter MSISDN or Email Address\n';
                ctr++;
          }           
		}
	   }
	}

 
    //if counter was incrementedin the for loop then alert the error messages

	if(ctr > 0 && message!= '' && message!= "")
	{
		alert(ctr)
        alert(message);
		return false;
	}
    else
    {
     return true;
    }

}
