Skip to content
This repository
Browse code

Pulled from the latest changes + Merged with selectbox and chosen lib…

…raries with demos
  • Loading branch information...
commit d1eab52ad4c7cac42b019ce2f4625302ad0a1362 1 parent 3fe47bc
Bimo Wijoyo authored May 22, 2012
292  demos/demoChosenLibrary.html
... ...
@@ -0,0 +1,292 @@
  1
+<!DOCTYPE html>
  2
+<html>
  3
+	<head>
  4
+		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  5
+		<title>JQuery Validation Engine</title>
  6
+		<link rel="stylesheet" href="../css/validationEngine.jquery.css" type="text/css"/>
  7
+		<link rel="stylesheet" href="../css/template.css" type="text/css"/>
  8
+		<link rel="stylesheet" href="http://harvesthq.github.com/chosen/chosen/chosen.css" type="text/css"/>
  9
+		<script src="../js/jquery-1.6.min.js" type="text/javascript"></script>
  10
+		<script src="../js/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
  11
+		<script src="../js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
  12
+		<script src="http://harvesthq.github.com/chosen/chosen/chosen.jquery.js" type="text/javascript"></script>
  13
+		<script>
  14
+			jQuery(document).ready(function() {
  15
+				// binds form submission and fields to the validation engine
  16
+				jQuery("#formID").validationEngine({
  17
+					prettySelect : true,
  18
+					useSuffix: "_chzn"
  19
+					//promptPosition : "bottomLeft"
  20
+				});
  21
+				$("#country").chosen({
  22
+					allow_single_deselect : true
  23
+				});
  24
+			});
  25
+		</script>
  26
+	</head>
  27
+	<body>
  28
+		<p>
  29
+			<a href="../index.html" onclick="">Back to index</a>
  30
+		</p>
  31
+		<p>
  32
+			This demonstration shows the validation with the <a href="http://harvesthq.github.com/chosen/">Chosen Library</a>
  33
+		</p>
  34
+		<form id="formID" class="formular" method="post" action="">
  35
+			<fieldset>
  36
+				<legend>
  37
+					Select single
  38
+				</legend>
  39
+				<label>
  40
+					<select name="country" id="country" class="validate[required]">
  41
+						<option value=""></option>
  42
+						<option value="United States">United States</option>
  43
+						<option value="United Kingdom">United Kingdom</option>
  44
+						<option value="Afghanistan">Afghanistan</option>
  45
+						<option value="Albania">Albania</option>
  46
+						<option value="Algeria">Algeria</option>
  47
+						<option value="American Samoa">American Samoa</option>
  48
+						<option value="Andorra">Andorra</option>
  49
+						<option value="Angola">Angola</option>
  50
+						<option value="Anguilla">Anguilla</option>
  51
+						<option value="Antarctica">Antarctica</option>
  52
+						<option value="Antigua and Barbuda">Antigua and Barbuda</option>
  53
+						<option value="Argentina">Argentina</option>
  54
+						<option value="Armenia">Armenia</option>
  55
+						<option value="Aruba">Aruba</option>
  56
+						<option value="Australia">Australia</option>
  57
+						<option value="Austria">Austria</option>
  58
+						<option value="Azerbaijan">Azerbaijan</option>
  59
+						<option value="Bahamas">Bahamas</option>
  60
+						<option value="Bahrain">Bahrain</option>
  61
+						<option value="Bangladesh">Bangladesh</option>
  62
+						<option value="Barbados">Barbados</option>
  63
+						<option value="Belarus">Belarus</option>
  64
+						<option value="Belgium">Belgium</option>
  65
+						<option value="Belize">Belize</option>
  66
+						<option value="Benin">Benin</option>
  67
+						<option value="Bermuda">Bermuda</option>
  68
+						<option value="Bhutan">Bhutan</option>
  69
+						<option value="Bolivia">Bolivia</option>
  70
+						<option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
  71
+						<option value="Botswana">Botswana</option>
  72
+						<option value="Bouvet Island">Bouvet Island</option>
  73
+						<option value="Brazil">Brazil</option>
  74
+						<option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
  75
+						<option value="Brunei Darussalam">Brunei Darussalam</option>
  76
+						<option value="Bulgaria">Bulgaria</option>
  77
+						<option value="Burkina Faso">Burkina Faso</option>
  78
+						<option value="Burundi">Burundi</option>
  79
+						<option value="Cambodia">Cambodia</option>
  80
+						<option value="Cameroon">Cameroon</option>
  81
+						<option value="Canada">Canada</option>
  82
+						<option value="Cape Verde">Cape Verde</option>
  83
+						<option value="Cayman Islands">Cayman Islands</option>
  84
+						<option value="Central African Republic">Central African Republic</option>
  85
+						<option value="Chad">Chad</option>
  86
+						<option value="Chile">Chile</option>
  87
+						<option value="China">China</option>
  88
+						<option value="Christmas Island">Christmas Island</option>
  89
+						<option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
  90
+						<option value="Colombia">Colombia</option>
  91
+						<option value="Comoros">Comoros</option>
  92
+						<option value="Congo">Congo</option>
  93
+						<option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
  94
+						<option value="Cook Islands">Cook Islands</option>
  95
+						<option value="Costa Rica">Costa Rica</option>
  96
+						<option value="Cote D'ivoire">Cote D'ivoire</option>
  97
+						<option value="Croatia">Croatia</option>
  98
+						<option value="Cuba">Cuba</option>
  99
+						<option value="Cyprus">Cyprus</option>
  100
+						<option value="Czech Republic">Czech Republic</option>
  101
+						<option value="Denmark">Denmark</option>
  102
+						<option value="Djibouti">Djibouti</option>
  103
+						<option value="Dominica">Dominica</option>
  104
+						<option value="Dominican Republic">Dominican Republic</option>
  105
+						<option value="Ecuador">Ecuador</option>
  106
+						<option value="Egypt">Egypt</option>
  107
+						<option value="El Salvador">El Salvador</option>
  108
+						<option value="Equatorial Guinea">Equatorial Guinea</option>
  109
+						<option value="Eritrea">Eritrea</option>
  110
+						<option value="Estonia">Estonia</option>
  111
+						<option value="Ethiopia">Ethiopia</option>
  112
+						<option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
  113
+						<option value="Faroe Islands">Faroe Islands</option>
  114
+						<option value="Fiji">Fiji</option>
  115
+						<option value="Finland">Finland</option>
  116
+						<option value="France">France</option>
  117
+						<option value="French Guiana">French Guiana</option>
  118
+						<option value="French Polynesia">French Polynesia</option>
  119
+						<option value="French Southern Territories">French Southern Territories</option>
  120
+						<option value="Gabon">Gabon</option>
  121
+						<option value="Gambia">Gambia</option>
  122
+						<option value="Georgia">Georgia</option>
  123
+						<option value="Germany">Germany</option>
  124
+						<option value="Ghana">Ghana</option>
  125
+						<option value="Gibraltar">Gibraltar</option>
  126
+						<option value="Greece">Greece</option>
  127
+						<option value="Greenland">Greenland</option>
  128
+						<option value="Grenada">Grenada</option>
  129
+						<option value="Guadeloupe">Guadeloupe</option>
  130
+						<option value="Guam">Guam</option>
  131
+						<option value="Guatemala">Guatemala</option>
  132
+						<option value="Guinea">Guinea</option>
  133
+						<option value="Guinea-bissau">Guinea-bissau</option>
  134
+						<option value="Guyana">Guyana</option>
  135
+						<option value="Haiti">Haiti</option>
  136
+						<option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
  137
+						<option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
  138
+						<option value="Honduras">Honduras</option>
  139
+						<option value="Hong Kong">Hong Kong</option>
  140
+						<option value="Hungary">Hungary</option>
  141
+						<option value="Iceland">Iceland</option>
  142
+						<option value="India">India</option>
  143
+						<option value="Indonesia">Indonesia</option>
  144
+						<option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
  145
+						<option value="Iraq">Iraq</option>
  146
+						<option value="Ireland">Ireland</option>
  147
+						<option value="Israel">Israel</option>
  148
+						<option value="Italy">Italy</option>
  149
+						<option value="Jamaica">Jamaica</option>
  150
+						<option value="Japan">Japan</option>
  151
+						<option value="Jordan">Jordan</option>
  152
+						<option value="Kazakhstan">Kazakhstan</option>
  153
+						<option value="Kenya">Kenya</option>
  154
+						<option value="Kiribati">Kiribati</option>
  155
+						<option value="Korea, Democratic People's Republic of">Korea, Democratic People's Republic of</option>
  156
+						<option value="Korea, Republic of">Korea, Republic of</option>
  157
+						<option value="Kuwait">Kuwait</option>
  158
+						<option value="Kyrgyzstan">Kyrgyzstan</option>
  159
+						<option value="Lao People's Democratic Republic">Lao People's Democratic Republic</option>
  160
+						<option value="Latvia">Latvia</option>
  161
+						<option value="Lebanon">Lebanon</option>
  162
+						<option value="Lesotho">Lesotho</option>
  163
+						<option value="Liberia">Liberia</option>
  164
+						<option value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya</option>
  165
+						<option value="Liechtenstein">Liechtenstein</option>
  166
+						<option value="Lithuania">Lithuania</option>
  167
+						<option value="Luxembourg">Luxembourg</option>
  168
+						<option value="Macao">Macao</option>
  169
+						<option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
  170
+						<option value="Madagascar">Madagascar</option>
  171
+						<option value="Malawi">Malawi</option>
  172
+						<option value="Malaysia">Malaysia</option>
  173
+						<option value="Maldives">Maldives</option>
  174
+						<option value="Mali">Mali</option>
  175
+						<option value="Malta">Malta</option>
  176
+						<option value="Marshall Islands">Marshall Islands</option>
  177
+						<option value="Martinique">Martinique</option>
  178
+						<option value="Mauritania">Mauritania</option>
  179
+						<option value="Mauritius">Mauritius</option>
  180
+						<option value="Mayotte">Mayotte</option>
  181
+						<option value="Mexico">Mexico</option>
  182
+						<option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
  183
+						<option value="Moldova, Republic of">Moldova, Republic of</option>
  184
+						<option value="Monaco">Monaco</option>
  185
+						<option value="Mongolia">Mongolia</option>
  186
+						<option value="Montenegro">Montenegro</option>
  187
+						<option value="Montserrat">Montserrat</option>
  188
+						<option value="Morocco">Morocco</option>
  189
+						<option value="Mozambique">Mozambique</option>
  190
+						<option value="Myanmar">Myanmar</option>
  191
+						<option value="Namibia">Namibia</option>
  192
+						<option value="Nauru">Nauru</option>
  193
+						<option value="Nepal">Nepal</option>
  194
+						<option value="Netherlands">Netherlands</option>
  195
+						<option value="Netherlands Antilles">Netherlands Antilles</option>
  196
+						<option value="New Caledonia">New Caledonia</option>
  197
+						<option value="New Zealand">New Zealand</option>
  198
+						<option value="Nicaragua">Nicaragua</option>
  199
+						<option value="Niger">Niger</option>
  200
+						<option value="Nigeria">Nigeria</option>
  201
+						<option value="Niue">Niue</option>
  202
+						<option value="Norfolk Island">Norfolk Island</option>
  203
+						<option value="Northern Mariana Islands">Northern Mariana Islands</option>
  204
+						<option value="Norway">Norway</option>
  205
+						<option value="Oman">Oman</option>
  206
+						<option value="Pakistan">Pakistan</option>
  207
+						<option value="Palau">Palau</option>
  208
+						<option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
  209
+						<option value="Panama">Panama</option>
  210
+						<option value="Papua New Guinea">Papua New Guinea</option>
  211
+						<option value="Paraguay">Paraguay</option>
  212
+						<option value="Peru">Peru</option>
  213
+						<option value="Philippines">Philippines</option>
  214
+						<option value="Pitcairn">Pitcairn</option>
  215
+						<option value="Poland">Poland</option>
  216
+						<option value="Portugal">Portugal</option>
  217
+						<option value="Puerto Rico">Puerto Rico</option>
  218
+						<option value="Qatar">Qatar</option>
  219
+						<option value="Reunion">Reunion</option>
  220
+						<option value="Romania">Romania</option>
  221
+						<option value="Russian Federation">Russian Federation</option>
  222
+						<option value="Rwanda">Rwanda</option>
  223
+						<option value="Saint Helena">Saint Helena</option>
  224
+						<option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
  225
+						<option value="Saint Lucia">Saint Lucia</option>
  226
+						<option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
  227
+						<option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
  228
+						<option value="Samoa">Samoa</option>
  229
+						<option value="San Marino">San Marino</option>
  230
+						<option value="Sao Tome and Principe">Sao Tome and Principe</option>
  231
+						<option value="Saudi Arabia">Saudi Arabia</option>
  232
+						<option value="Senegal">Senegal</option>
  233
+						<option value="Serbia">Serbia</option>
  234
+						<option value="Seychelles">Seychelles</option>
  235
+						<option value="Sierra Leone">Sierra Leone</option>
  236
+						<option value="Singapore">Singapore</option>
  237
+						<option value="Slovakia">Slovakia</option>
  238
+						<option value="Slovenia">Slovenia</option>
  239
+						<option value="Solomon Islands">Solomon Islands</option>
  240
+						<option value="Somalia">Somalia</option>
  241
+						<option value="South Africa">South Africa</option>
  242
+						<option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
  243
+						<option value="South Sudan">South Sudan</option>
  244
+						<option value="Spain">Spain</option>
  245
+						<option value="Sri Lanka">Sri Lanka</option>
  246
+						<option value="Sudan">Sudan</option>
  247
+						<option value="Suriname">Suriname</option>
  248
+						<option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
  249
+						<option value="Swaziland">Swaziland</option>
  250
+						<option value="Sweden">Sweden</option>
  251
+						<option value="Switzerland">Switzerland</option>
  252
+						<option value="Syrian Arab Republic">Syrian Arab Republic</option>
  253
+						<option value="Taiwan, Republic of China">Taiwan, Republic of China</option>
  254
+						<option value="Tajikistan">Tajikistan</option>
  255
+						<option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
  256
+						<option value="Thailand">Thailand</option>
  257
+						<option value="Timor-leste">Timor-leste</option>
  258
+						<option value="Togo">Togo</option>
  259
+						<option value="Tokelau">Tokelau</option>
  260
+						<option value="Tonga">Tonga</option>
  261
+						<option value="Trinidad and Tobago">Trinidad and Tobago</option>
  262
+						<option value="Tunisia">Tunisia</option>
  263
+						<option value="Turkey">Turkey</option>
  264
+						<option value="Turkmenistan">Turkmenistan</option>
  265
+						<option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
  266
+						<option value="Tuvalu">Tuvalu</option>
  267
+						<option value="Uganda">Uganda</option>
  268
+						<option value="Ukraine">Ukraine</option>
  269
+						<option value="United Arab Emirates">United Arab Emirates</option>
  270
+						<option value="United Kingdom">United Kingdom</option>
  271
+						<option value="United States">United States</option>
  272
+						<option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
  273
+						<option value="Uruguay">Uruguay</option>
  274
+						<option value="Uzbekistan">Uzbekistan</option>
  275
+						<option value="Vanuatu">Vanuatu</option>
  276
+						<option value="Venezuela">Venezuela</option>
  277
+						<option value="Viet Nam">Viet Nam</option>
  278
+						<option value="Virgin Islands, British">Virgin Islands, British</option>
  279
+						<option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
  280
+						<option value="Wallis and Futuna">Wallis and Futuna</option>
  281
+						<option value="Western Sahara">Western Sahara</option>
  282
+						<option value="Yemen">Yemen</option>
  283
+						<option value="Zambia">Zambia</option>
  284
+						<option value="Zimbabwe">Zimbabwe</option>
  285
+					</select> </label>
  286
+			</fieldset>
  287
+
  288
+			<input class="submit" type="submit" value="Validate &amp; Send the form!"/>
  289
+			<hr/>
  290
+		</form>
  291
+	</body>
  292
+</html>
303  demos/demoSelectBoxLibrary.html
... ...
@@ -0,0 +1,303 @@
  1
+<!DOCTYPE html>
  2
+<html>
  3
+	<head>
  4
+		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  5
+		<title>JQuery Validation Engine</title>
  6
+		<link rel="stylesheet" href="../css/validationEngine.jquery.css" type="text/css"/>
  7
+		<link rel="stylesheet" href="../css/template.css" type="text/css"/>
  8
+		<link rel="stylesheet" href="http://labs.abeautifulsite.net/jquery-selectBox/jquery.selectBox.css" type="text/css" />
  9
+		<script src="../js/jquery-1.6.min.js" type="text/javascript"></script>
  10
+		<script src="../js/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
  11
+		<script src="../js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
  12
+		<script src="http://labs.abeautifulsite.net/jquery-selectBox/jquery.selectBox.js" type="text/javascript"></script>
  13
+		<script>
  14
+			jQuery(document).ready(function() {
  15
+
  16
+				var prefix = "selectBox_"
  17
+
  18
+				// binds form submission and fields to the validation engine
  19
+				jQuery("#formID").validationEngine({
  20
+					prettySelect : true,
  21
+					usePrefix: prefix
  22
+				});
  23
+
  24
+				$("#country").selectBox();
  25
+
  26
+				// By default, selectBox does not create an id to the newly created element - We need to add this manually
  27
+				$('select').each(function(){ 
  28
+					// The jquery validation engine needs an id on the "a" element created by selectBox plugin
  29
+			    $(this).next('a.selectBox')
  30
+			    // Since id needs to be unique, we use a prefix here (can use suffix - up to you)
  31
+			    .attr("id", prefix + this.id )
  32
+			    // By default, all classes are passed on to the new element - Important: We need to remove it
  33
+			    .removeClass("validate[required]");		
  34
+			  })
  35
+			});
  36
+		</script>
  37
+	</head>
  38
+	<body>
  39
+		<p>
  40
+			<a href="../index.html" onclick="">Back to index</a>
  41
+		</p>
  42
+		<p>
  43
+			This demonstration shows the validation with the <a href="https://github.com/claviska/jquery-selectBox">jQuery SelectBox plugin</a>
  44
+		</p>
  45
+		<form id="formID" class="formular" method="post" action="">
  46
+			<fieldset>
  47
+				<legend>
  48
+					Select single
  49
+				</legend>
  50
+				<label>
  51
+					<select name="country" id="country" class="validate[required]">
  52
+						<option value="">- Please Select -</option>
  53
+						<option value="United States">United States</option>
  54
+						<option value="United Kingdom">United Kingdom</option>
  55
+						<option value="Afghanistan">Afghanistan</option>
  56
+						<option value="Albania">Albania</option>
  57
+						<option value="Algeria">Algeria</option>
  58
+						<option value="American Samoa">American Samoa</option>
  59
+						<option value="Andorra">Andorra</option>
  60
+						<option value="Angola">Angola</option>
  61
+						<option value="Anguilla">Anguilla</option>
  62
+						<option value="Antarctica">Antarctica</option>
  63
+						<option value="Antigua and Barbuda">Antigua and Barbuda</option>
  64
+						<option value="Argentina">Argentina</option>
  65
+						<option value="Armenia">Armenia</option>
  66
+						<option value="Aruba">Aruba</option>
  67
+						<option value="Australia">Australia</option>
  68
+						<option value="Austria">Austria</option>
  69
+						<option value="Azerbaijan">Azerbaijan</option>
  70
+						<option value="Bahamas">Bahamas</option>
  71
+						<option value="Bahrain">Bahrain</option>
  72
+						<option value="Bangladesh">Bangladesh</option>
  73
+						<option value="Barbados">Barbados</option>
  74
+						<option value="Belarus">Belarus</option>
  75
+						<option value="Belgium">Belgium</option>
  76
+						<option value="Belize">Belize</option>
  77
+						<option value="Benin">Benin</option>
  78
+						<option value="Bermuda">Bermuda</option>
  79
+						<option value="Bhutan">Bhutan</option>
  80
+						<option value="Bolivia">Bolivia</option>
  81
+						<option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
  82
+						<option value="Botswana">Botswana</option>
  83
+						<option value="Bouvet Island">Bouvet Island</option>
  84
+						<option value="Brazil">Brazil</option>
  85
+						<option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
  86
+						<option value="Brunei Darussalam">Brunei Darussalam</option>
  87
+						<option value="Bulgaria">Bulgaria</option>
  88
+						<option value="Burkina Faso">Burkina Faso</option>
  89
+						<option value="Burundi">Burundi</option>
  90
+						<option value="Cambodia">Cambodia</option>
  91
+						<option value="Cameroon">Cameroon</option>
  92
+						<option value="Canada">Canada</option>
  93
+						<option value="Cape Verde">Cape Verde</option>
  94
+						<option value="Cayman Islands">Cayman Islands</option>
  95
+						<option value="Central African Republic">Central African Republic</option>
  96
+						<option value="Chad">Chad</option>
  97
+						<option value="Chile">Chile</option>
  98
+						<option value="China">China</option>
  99
+						<option value="Christmas Island">Christmas Island</option>
  100
+						<option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
  101
+						<option value="Colombia">Colombia</option>
  102
+						<option value="Comoros">Comoros</option>
  103
+						<option value="Congo">Congo</option>
  104
+						<option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
  105
+						<option value="Cook Islands">Cook Islands</option>
  106
+						<option value="Costa Rica">Costa Rica</option>
  107
+						<option value="Cote D'ivoire">Cote D'ivoire</option>
  108
+						<option value="Croatia">Croatia</option>
  109
+						<option value="Cuba">Cuba</option>
  110
+						<option value="Cyprus">Cyprus</option>
  111
+						<option value="Czech Republic">Czech Republic</option>
  112
+						<option value="Denmark">Denmark</option>
  113
+						<option value="Djibouti">Djibouti</option>
  114
+						<option value="Dominica">Dominica</option>
  115
+						<option value="Dominican Republic">Dominican Republic</option>
  116
+						<option value="Ecuador">Ecuador</option>
  117
+						<option value="Egypt">Egypt</option>
  118
+						<option value="El Salvador">El Salvador</option>
  119
+						<option value="Equatorial Guinea">Equatorial Guinea</option>
  120
+						<option value="Eritrea">Eritrea</option>
  121
+						<option value="Estonia">Estonia</option>
  122
+						<option value="Ethiopia">Ethiopia</option>
  123
+						<option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
  124
+						<option value="Faroe Islands">Faroe Islands</option>
  125
+						<option value="Fiji">Fiji</option>
  126
+						<option value="Finland">Finland</option>
  127
+						<option value="France">France</option>
  128
+						<option value="French Guiana">French Guiana</option>
  129
+						<option value="French Polynesia">French Polynesia</option>
  130
+						<option value="French Southern Territories">French Southern Territories</option>
  131
+						<option value="Gabon">Gabon</option>
  132
+						<option value="Gambia">Gambia</option>
  133
+						<option value="Georgia">Georgia</option>
  134
+						<option value="Germany">Germany</option>
  135
+						<option value="Ghana">Ghana</option>
  136
+						<option value="Gibraltar">Gibraltar</option>
  137
+						<option value="Greece">Greece</option>
  138
+						<option value="Greenland">Greenland</option>
  139
+						<option value="Grenada">Grenada</option>
  140
+						<option value="Guadeloupe">Guadeloupe</option>
  141
+						<option value="Guam">Guam</option>
  142
+						<option value="Guatemala">Guatemala</option>
  143
+						<option value="Guinea">Guinea</option>
  144
+						<option value="Guinea-bissau">Guinea-bissau</option>
  145
+						<option value="Guyana">Guyana</option>
  146
+						<option value="Haiti">Haiti</option>
  147
+						<option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
  148
+						<option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
  149
+						<option value="Honduras">Honduras</option>
  150
+						<option value="Hong Kong">Hong Kong</option>
  151
+						<option value="Hungary">Hungary</option>
  152
+						<option value="Iceland">Iceland</option>
  153
+						<option value="India">India</option>
  154
+						<option value="Indonesia">Indonesia</option>
  155
+						<option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
  156
+						<option value="Iraq">Iraq</option>
  157
+						<option value="Ireland">Ireland</option>
  158
+						<option value="Israel">Israel</option>
  159
+						<option value="Italy">Italy</option>
  160
+						<option value="Jamaica">Jamaica</option>
  161
+						<option value="Japan">Japan</option>
  162
+						<option value="Jordan">Jordan</option>
  163
+						<option value="Kazakhstan">Kazakhstan</option>
  164
+						<option value="Kenya">Kenya</option>
  165
+						<option value="Kiribati">Kiribati</option>
  166
+						<option value="Korea, Democratic People's Republic of">Korea, Democratic People's Republic of</option>
  167
+						<option value="Korea, Republic of">Korea, Republic of</option>
  168
+						<option value="Kuwait">Kuwait</option>
  169
+						<option value="Kyrgyzstan">Kyrgyzstan</option>
  170
+						<option value="Lao People's Democratic Republic">Lao People's Democratic Republic</option>
  171
+						<option value="Latvia">Latvia</option>
  172
+						<option value="Lebanon">Lebanon</option>
  173
+						<option value="Lesotho">Lesotho</option>
  174
+						<option value="Liberia">Liberia</option>
  175
+						<option value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya</option>
  176
+						<option value="Liechtenstein">Liechtenstein</option>
  177
+						<option value="Lithuania">Lithuania</option>
  178
+						<option value="Luxembourg">Luxembourg</option>
  179
+						<option value="Macao">Macao</option>
  180
+						<option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
  181
+						<option value="Madagascar">Madagascar</option>
  182
+						<option value="Malawi">Malawi</option>
  183
+						<option value="Malaysia">Malaysia</option>
  184
+						<option value="Maldives">Maldives</option>
  185
+						<option value="Mali">Mali</option>
  186
+						<option value="Malta">Malta</option>
  187
+						<option value="Marshall Islands">Marshall Islands</option>
  188
+						<option value="Martinique">Martinique</option>
  189
+						<option value="Mauritania">Mauritania</option>
  190
+						<option value="Mauritius">Mauritius</option>
  191
+						<option value="Mayotte">Mayotte</option>
  192
+						<option value="Mexico">Mexico</option>
  193
+						<option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
  194
+						<option value="Moldova, Republic of">Moldova, Republic of</option>
  195
+						<option value="Monaco">Monaco</option>
  196
+						<option value="Mongolia">Mongolia</option>
  197
+						<option value="Montenegro">Montenegro</option>
  198
+						<option value="Montserrat">Montserrat</option>
  199
+						<option value="Morocco">Morocco</option>
  200
+						<option value="Mozambique">Mozambique</option>
  201
+						<option value="Myanmar">Myanmar</option>
  202
+						<option value="Namibia">Namibia</option>
  203
+						<option value="Nauru">Nauru</option>
  204
+						<option value="Nepal">Nepal</option>
  205
+						<option value="Netherlands">Netherlands</option>
  206
+						<option value="Netherlands Antilles">Netherlands Antilles</option>
  207
+						<option value="New Caledonia">New Caledonia</option>
  208
+						<option value="New Zealand">New Zealand</option>
  209
+						<option value="Nicaragua">Nicaragua</option>
  210
+						<option value="Niger">Niger</option>
  211
+						<option value="Nigeria">Nigeria</option>
  212
+						<option value="Niue">Niue</option>
  213
+						<option value="Norfolk Island">Norfolk Island</option>
  214
+						<option value="Northern Mariana Islands">Northern Mariana Islands</option>
  215
+						<option value="Norway">Norway</option>
  216
+						<option value="Oman">Oman</option>
  217
+						<option value="Pakistan">Pakistan</option>
  218
+						<option value="Palau">Palau</option>
  219
+						<option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
  220
+						<option value="Panama">Panama</option>
  221
+						<option value="Papua New Guinea">Papua New Guinea</option>
  222
+						<option value="Paraguay">Paraguay</option>
  223
+						<option value="Peru">Peru</option>
  224
+						<option value="Philippines">Philippines</option>
  225
+						<option value="Pitcairn">Pitcairn</option>
  226
+						<option value="Poland">Poland</option>
  227
+						<option value="Portugal">Portugal</option>
  228
+						<option value="Puerto Rico">Puerto Rico</option>
  229
+						<option value="Qatar">Qatar</option>
  230
+						<option value="Reunion">Reunion</option>
  231
+						<option value="Romania">Romania</option>
  232
+						<option value="Russian Federation">Russian Federation</option>
  233
+						<option value="Rwanda">Rwanda</option>
  234
+						<option value="Saint Helena">Saint Helena</option>
  235
+						<option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
  236
+						<option value="Saint Lucia">Saint Lucia</option>
  237
+						<option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
  238
+						<option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
  239
+						<option value="Samoa">Samoa</option>
  240
+						<option value="San Marino">San Marino</option>
  241
+						<option value="Sao Tome and Principe">Sao Tome and Principe</option>
  242
+						<option value="Saudi Arabia">Saudi Arabia</option>
  243
+						<option value="Senegal">Senegal</option>
  244
+						<option value="Serbia">Serbia</option>
  245
+						<option value="Seychelles">Seychelles</option>
  246
+						<option value="Sierra Leone">Sierra Leone</option>
  247
+						<option value="Singapore">Singapore</option>
  248
+						<option value="Slovakia">Slovakia</option>
  249
+						<option value="Slovenia">Slovenia</option>
  250
+						<option value="Solomon Islands">Solomon Islands</option>
  251
+						<option value="Somalia">Somalia</option>
  252
+						<option value="South Africa">South Africa</option>
  253
+						<option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
  254
+						<option value="South Sudan">South Sudan</option>
  255
+						<option value="Spain">Spain</option>
  256
+						<option value="Sri Lanka">Sri Lanka</option>
  257
+						<option value="Sudan">Sudan</option>
  258
+						<option value="Suriname">Suriname</option>
  259
+						<option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
  260
+						<option value="Swaziland">Swaziland</option>
  261
+						<option value="Sweden">Sweden</option>
  262
+						<option value="Switzerland">Switzerland</option>
  263
+						<option value="Syrian Arab Republic">Syrian Arab Republic</option>
  264
+						<option value="Taiwan, Republic of China">Taiwan, Republic of China</option>
  265
+						<option value="Tajikistan">Tajikistan</option>
  266
+						<option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
  267
+						<option value="Thailand">Thailand</option>
  268
+						<option value="Timor-leste">Timor-leste</option>
  269
+						<option value="Togo">Togo</option>
  270
+						<option value="Tokelau">Tokelau</option>
  271
+						<option value="Tonga">Tonga</option>
  272
+						<option value="Trinidad and Tobago">Trinidad and Tobago</option>
  273
+						<option value="Tunisia">Tunisia</option>
  274
+						<option value="Turkey">Turkey</option>
  275
+						<option value="Turkmenistan">Turkmenistan</option>
  276
+						<option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
  277
+						<option value="Tuvalu">Tuvalu</option>
  278
+						<option value="Uganda">Uganda</option>
  279
+						<option value="Ukraine">Ukraine</option>
  280
+						<option value="United Arab Emirates">United Arab Emirates</option>
  281
+						<option value="United Kingdom">United Kingdom</option>
  282
+						<option value="United States">United States</option>
  283
+						<option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
  284
+						<option value="Uruguay">Uruguay</option>
  285
+						<option value="Uzbekistan">Uzbekistan</option>
  286
+						<option value="Vanuatu">Vanuatu</option>
  287
+						<option value="Venezuela">Venezuela</option>
  288
+						<option value="Viet Nam">Viet Nam</option>
  289
+						<option value="Virgin Islands, British">Virgin Islands, British</option>
  290
+						<option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
  291
+						<option value="Wallis and Futuna">Wallis and Futuna</option>
  292
+						<option value="Western Sahara">Western Sahara</option>
  293
+						<option value="Yemen">Yemen</option>
  294
+						<option value="Zambia">Zambia</option>
  295
+						<option value="Zimbabwe">Zimbabwe</option>
  296
+					</select> </label>
  297
+			</fieldset>
  298
+
  299
+			<input class="submit" type="submit" value="Validate &amp; Send the form!"/>
  300
+			<hr/>
  301
+		</form>
  302
+	</body>
  303
+</html>
6  index.html
@@ -56,6 +56,12 @@
56 56
 		<li>
57 57
 			<a href="demos/demoPositioning.html">Demo Positioning</a>
58 58
 		</li>
  59
+		<li>
  60
+			<a href="demos/demoChosenLibrary.html">Demo Chosen Library</a>
  61
+		</li>
  62
+		<li>
  63
+			<a href="demos/demoSelectBoxLibrary.html">Demo jQuery-SelectBox Library</a>
  64
+		</li>
59 65
 	</ul>
60 66
 	<h2>Documentation</h2>
61 67
 	<a href="https://github.com/posabsolute/jQuery-Validation-Engine">Github</a>
27  js/jquery.validationEngine.js
@@ -143,7 +143,7 @@
143 143
 
144 144
 			var options = form.data('jqv');
145 145
 			// No option, take default one
146  
-			form.find('['+options.validateAttribute+'*=validate]').not(':hidden').not(":disabled").each(function(){
  146
+			form.find('['+options.validateAttribute+'*=validate]').not(":disabled").each(function(){
147 147
 				var field = $(this);
148 148
 				var prompt = methods._getPrompt(field);
149 149
 				var promptText = $(prompt).find(".formErrorContent").html();
@@ -291,13 +291,16 @@
291 291
 			form.trigger("jqv.form.validating");
292 292
 			// first, evaluate status of non ajax fields
293 293
 			var first_err=null;
294  
-			form.find('['+options.validateAttribute+'*=validate]').not(':hidden').not(":disabled").each( function() {
  294
+			form.find('['+options.validateAttribute+'*=validate]').not(":disabled").each( function() {
295 295
 				var field = $(this);
296 296
 				var names = [];
297 297
 				if ($.inArray(field.attr('name'), names) < 0) {
298 298
 					errorFound |= methods._validateField(field, options, skipAjaxValidation);
299 299
 					if (errorFound && first_err==null)
300  
-						first_err=field;
  300
+						if (field.is(":hidden") && options.prettySelect)
  301
+                first_err = field = form.find("#" + options.usePrefix + field.attr('id') + options.useSuffix);
  302
+            else
  303
+                first_err=field;
301 304
 					if (options.doNotShowAllErrosOnSubmit)
302 305
 						return false;
303 306
 					names.push(field.attr('name'));
@@ -448,6 +451,9 @@
448 451
 				++$.validationEngine.fieldIdCounter;
449 452
 			}
450 453
 
  454
+      if (field.is(":hidden") && !options.prettySelect)
  455
+          return false;
  456
+
451 457
 			var rulesParsing = field.attr(options.validateAttribute);
452 458
 			var getRules = /validate\[(.*)\]/.exec(rulesParsing);
453 459
 
@@ -581,6 +587,10 @@
581 587
 				options.showArrow = false;
582 588
 			}
583 589
 
  590
+			if(field.is(":hidden") && options.prettySelect) {
  591
+        field = form.find("#" + options.usePrefix + field.attr('id') + options.useSuffix);
  592
+      }
  593
+
584 594
 			if (options.isError){
585 595
 				methods._showPrompt(field, promptText, "", false, options);
586 596
 			}else{
@@ -1224,8 +1234,7 @@
1224 1234
 			var prompt = $('<div>');
1225 1235
 			prompt.addClass(methods._getClassName(field.attr("id")) + "formError");
1226 1236
 			// add a class name to identify the parent form of the prompt
1227  
-			if(field.is(":input"))
1228  
-				prompt.addClass("parentForm"+methods._getClassName(field.parents('form').attr("id")));
  1237
+			prompt.addClass("parentForm"+methods._getClassName(field.parents('form').attr("id")));
1229 1238
 			prompt.addClass("formError");
1230 1239
 
1231 1240
 			switch (type) {
@@ -1631,7 +1640,13 @@
1631 1640
 		// Delay before auto-hide
1632 1641
 		autoHideDelay: 10000,
1633 1642
 		// Fade out duration while hiding the validations
1634  
-		fadeDuration: 0.3
  1643
+		fadeDuration: 0.3,
  1644
+    // Use Prettify select library
  1645
+    prettySelect: false,
  1646
+    // Custom ID uses prefix
  1647
+    usePrefix: "",
  1648
+    // Custom ID uses suffix
  1649
+    useSuffix: ""
1635 1650
 	}};
1636 1651
 	$(function(){$.validationEngine.defaults.promptPosition = methods.isRTL()?'topLeft':"topRight"});
1637 1652
 })(jQuery);

0 notes on commit d1eab52

Please sign in to comment.
Something went wrong with that request. Please try again.