Commit 736a57a1b53cee8837b92a98ef1c630b6ba80a90

Authored by Jarrett Jordaan
1 parent feeecac2

PT-2280457: Country needed for registration.

Committed by: Jarrett Jordaan

Reviewed by: Megan Watson
setup/wizard/resources/js/wizard.js
... ... @@ -84,6 +84,7 @@ wizard.prototype.valRegHelper = function() {
84 84 var first = $("#first");
85 85 var last = $("#last");
86 86 var email = $("#email");
  87 + var country = $("#country");
87 88 if(first.attr('value').length < 1) {
88 89 $("#reg_error").html('Enter a First Name');
89 90 w.focusElement(first);
... ... @@ -109,7 +110,23 @@ wizard.prototype.valRegHelper = function() {
109 110 w.focusElement(email);
110 111 return false;
111 112 }
  113 + if(!w.countryCheck(country.attr('value'))) {
  114 + $("#reg_error").html('Please select a Country.');
  115 + w.focusElement(country);
  116 + return false;
  117 + }
  118 +
  119 + return true;
  120 +}
112 121  
  122 +wizard.prototype.countryCheck = function(str) {
  123 + //str = w.trim(str);
  124 + //alert(str);
  125 + if(str == "Select Country...") {
  126 + return false;
  127 + } else {
  128 + return true;
  129 + }
113 130 return true;
114 131 }
115 132  
... ... @@ -192,7 +209,6 @@ wizard.prototype.dummy = function () {
192 209  
193 210 // pre-submit callback
194 211 wizard.prototype.showRequest = function (formData, jqForm, options) {
195   - //$.blockUI({message:''});
196 212 $.blockUI({overlayCSS:{opacity:0.1}, fadeIn:500, fadeOut:500, message:''});
197 213 $('#loading').attr('style', 'display:block;');
198 214 }
... ...