Skip to content

Commit c0fb8b6

Browse files
committed
issue victorjonsson#159 , Made it possible to pass paramaters from form to server when using server validation
1 parent dd283eb commit c0fb8b6

11 files changed

+20
-12
lines changed

form-validator/date.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/#location-validators
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.beta.17
13+
* @version 2.2.beta.18
1414
*/
1515
(function($) {
1616

form-validator/file.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.beta.17
13+
* @version 2.2.beta.18
1414
*/
1515
(function($, window) {
1616

form-validator/form-test.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
<div class="form-group">
165165
<label class="control-label">Server validation</label>
166166
<input class="form-control" name="code" value="secret"
167-
data-validation-help="The word is &quot;secret&quot;"
167+
data-validation-helssp="The word is &quot;secret&quot;"
168168
data-validation="server"
169169
data-validation-url="http://formvalidator.net/validate-email.php" />
170170
</div>

form-validator/html5.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* @website http://formvalidator.net/
1919
* @license Dual licensed under the MIT or GPL Version 2 licenses
20-
* @version 2.2.beta.17
20+
* @version 2.2.beta.18
2121
*/
2222
(function($, window) {
2323

form-validator/jquery.form-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* @website http://formvalidator.net/
77
* @license Dual licensed under the MIT or GPL Version 2 licenses
8-
* @version 2.2.beta.17
8+
* @version 2.2.beta.18
99
*/
1010
(function($) {
1111

form-validator/jquery.form-validator.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/location.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @website http://formvalidator.net/#location-validators
1212
* @license Dual licensed under the MIT or GPL Version 2 licenses
13-
* @version 2.2.beta.17
13+
* @version 2.2.beta.18
1414
*/
1515
(function($) {
1616

form-validator/security.dev.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* - cvv
1414
*
1515
* @website http://formvalidator.net/#security-validators
16-
* @version 2.2.beta.17
16+
* @version 2.2.beta.18
1717
*/
1818
(function($, window) {
1919

@@ -333,11 +333,19 @@
333333
});
334334

335335
var requestServer = function(serverURL, $element, val, conf, callback) {
336+
var reqParams = $element.valAttr('req-params');
337+
if( !reqParams )
338+
reqParams = {};
339+
if( typeof reqParams == 'string' ) {
340+
reqParams = $.parseJSON(reqParams);
341+
}
342+
reqParams[$element.attr('name')] = val;
343+
336344
$.ajax({
337345
url : serverURL,
338346
type : 'POST',
339347
cache : false,
340-
data : $element.attr('name')+'='+val,
348+
data : reqParams,
341349
dataType : 'json',
342350
error : function(error) {
343351
alert('Server validation failed due to: '+error.statusText);

form-validator/security.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/sweden.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @website http://formvalidator.net/#swedish-validators
1515
* @license Dual licensed under the MIT or GPL Version 2 licenses
16-
* @version 2.2.beta.17
16+
* @version 2.2.beta.18
1717
*/
1818
(function($, window) {
1919

form-validator/uk.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* @website http://formvalidator.net/#uk-validators
1111
* @license Dual licensed under the MIT or GPL Version 2 licenses
12-
* @version 2.2.beta.17
12+
* @version 2.2.beta.18
1313
*/
1414
$.formUtils.addValidator({
1515
name : 'ukvatnumber',

0 commit comments

Comments
 (0)