Guest Posted February 15, 2011 Share Posted February 15, 2011 i have this script that is trying to check if a radio box is selected if so then the user is required to type in and input box. if the multipickup is selected and the user doesn't enter a pickupname or pickup email then it should throw an alert or if pseudopickup is selected it should also throw the same alert. ' if (shipping_value != null) {'."\n". ' index = ((shipping_value.indexOf("multipickup")) || (shipping_value.indexOf("pseudopickup"))) ;'."\n". ' if(index >= 0 ){'."\n". ' if (document.getElementById("pickupname").value == "") {'."\n". ' alert ("Please provide Recepient\'s First and Last Name ");'."\n". ' document.getElementById("pickupname").focus();'."\n". ' error = 2;'."\n". ' return false;'."\n". ' }'."\n". ' if (document.getElementById("pickupemail").value == "") {'."\n". ' alert ("Please provide Recepient\'s Email Address");'."\n". ' document.getElementById("pickupemail").focus();'."\n". ' error = 2;'."\n". ' return false;'."\n". ' }'."\n". ' if(error != 2 && document.getElementById("pickupemail").value.indexOf("@") <= 0) {'."\n". ' alert ("Please provide a valid Recepient\'s Email Address");'."\n". ' document.getElementById("pickupemail").focus();'."\n". ' error = 2;'."\n". ' return false;'."\n". ' }'."\n". ' }'."\n". ' }'."\n". Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.