1//--------------------------------------------------------------------------------------------------------------- 2//ONLOAD - Event: 3if (window.onload){ 4 var funWindowLoad = window.onload; 5 window.onload = new Function("funWindowLoad(); Window_OnLoad();"); 6} 7else 8 window.onload = Window_OnLoad; 9 10//--------------------------------------------------------------------------------------------------------------- 11function Window_OnLoad(){ 12 13 //Check to see if the _form has been set yet, it could have been set in uof.js: 14 if (_form == null) _form = document.frmMain; 15 16} 17//--------------------------------------------------------------------------------------------------------------- 18function SubmitReview(){ 19 20 //Get the form values: 21 var agentId = document.getElementById("tblReviewForm").getAttribute("registeredagentid"); 22 var agentName = Trim(_form.txtRegisteredAgentName.value); 23 var companyName = Trim(_form.txtCompanyName.value); 24 var email = Trim(_form.txtEmailFrom.value); 25 var firstName = Trim(_form.txtFirstName.value); 26 var lastName = Trim(_form.txtLastName.value); 27 var countryCode = _form.selCountry.value.toUpperCase(); 28 var countryDesc = _form.selCountry.options[_form.selCountry.options.selectedIndex].text; 29 var city = _form.txtCity.value; 30 var stateProvinceCode = _form.selStateProvince.value; 31 var stateProvinceDesc = (countryCode == "US" || countryCode == "CA"?_form.selStateProvince.options[_form.selStateProvince.options.selectedIndex].text:Trim(_form.txtStateProvince.value)); 32 var ratingLevel = GetRadioButtonValue(_form.radRating); 33 var comments = _form.txtComments.value; 34 var phone = _form.txtPhone.value; 35 36 //Company's Name: 37 if (companyName == ""){ 38 39 alert("Please enter your company's name."); 40 _form.txtCompanyName.focus(); 41 return; 42 } 43 //Email Address: 44 if (email == ""){ 45 46 alert("Please enter your email address."); 47 _form.txtEmailFrom.focus(); 48 return; 49 } 50 if (!IsEmail(email)){ 51 52 alert("Please enter a valid email address."); 53 _form.txtEmailFrom.focus(); 54 return; 55 56 } 57 if (email != Trim(_form.txtVerifyEmail.value)){ 58 59 alert("The second entry of your email address must match your first entry."); 60 _form.txtVerifyEmail.focus(); 61 return; 62 } 63 64 //First Name: 65 if (firstName == ""){ 66 67 alert("Please enter your first name."); 68 _form.txtFirstName.focus(); 69 return; 70 71 } 72 73 //Last Name: 74 if (lastName == ""){ 75 76 alert("Please enter your last name."); 77 _form.txtLastName.focus(); 78 return; 79 80 } 81 //Country: 82 if (countryCode == ""){ 83 84 alert("Please select your country."); 85 _form.selCountry.focus(); 86 return; 87 88 } 89 //City: 90 if (city == ""){ 91 92 alert("Please enter your city."); 93 _form.txtCity.focus(); 94 return; 95 96 } 97 98 switch (countryCode){ 99 100 case "US": 101 case "CA": 102 103 if (stateProvinceCode == ""){ 104 105 alert("Please select your state/province."); 106 _form.selStateProvince.focus(); 107 return; 108 109 } 110 111 break; 112 113 default: 114 115 if (stateProvinceDesc == ""){ 116 117 alert("Please enter your state/province."); 118 _form.txtStateProvince.focus(); 119 return; 120 121 } 122 123 break; 124 125 } 126 127 //Phone: 128 if (phone == ""){ 129 130 alert("Please enter your phone number."); 131 _form.txtPhone.focus(); 132 return; 133 134 } 135 136 //Rating: 137 if (ratingLevel == ""){ 138 139 alert("Please select a rating."); 140 return; 141 142 } 143 144 //Comments: 145 if (comments == ""){ 146 147 alert("Please enter your comments."); 148 _form.txtComments.focus(); 149 return; 150 151 } 152 153 _form.cmdSubmit.disabled = true; 154 155 var resultArray = cbInsertReview( 156 agentId, 157 agentName, 158 companyName, 159 email, 160 firstName, 161 lastName, 162 countryCode,
163 countryDesc, 164 city, 165 stateProvinceCode, 166 stateProvinceDesc, 167 ratingLevel, 168 comments, 169 phone); 170 171 //Evaluate the result: 172 if (resultArray[0] == "0"){ 173 174 alert("Thank you for submitting your review. NOTE, an email has been sent to your email account, please click on the link inside it to verify your email address. " + 175 "Once your email address has been verified, your review will appear on the site shortly."); 176 177 //Refresh the grid on the parent page: 178 document.location.href = "default.aspx"; 179 180 } 181 else { 182 183 //Show the error: 184 alert(resultArray[1]); 185 186 } 187 188 _form.cmdSubmit.disabled = false; 189 190} 191//--------------------------------------------------------------------------------------------------------------- 192function HandleCountryChange(selectControl){ 193 194 var localSelectControl = _form.selStateProvince; 195 var localTextBoxControl = _form.txtStateProvince; 196 197 switch (selectControl.value.toUpperCase()){ 198 199 case "US": 200 201 //Load the states: 202 LoadSelectOptions(localSelectControl, localSelectControl.getAttribute("statedata"), "<cb_row>", "<cb_col>"); 203 204 localSelectControl.style.display = "block"; 205 localTextBoxControl.style.display = "none"; 206 207 break; 208 209 case "CA": 210 211 //Load the provinces: 212 LoadSelectOptions(localSelectControl, localSelectControl.getAttribute("provincedata"), "<cb_row>", "<cb_col>"); 213 214 localSelectControl.style.display = "block"; 215 localTextBoxControl.style.display = "none"; 216 217 break; 218 219 default: 220 221 localSelectControl.style.display = "none"; 222 localTextBoxControl.style.display = "block"; 223 224 break; 225 226 } 227 228} 229//---------------------------------------------------------------------------------------------------------------
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.