Version 1.6.4 is now online. One major upgrade, you can now validate from any function in your script. You are no more bounded to the custom regex engine. And a minor update, you can now click on the bubble to make them disappear, in case they are in the way.
Here how it works:
In your field add:
<input value="" class="validate[required,funcCall[validate2fields]] text-input" type="text" id="lastname" name="lastname" />
In your language js file have something like (nname is the function name to call):
"validate2fields":{ "nname":"validate2fields", "alertText":"* You must have a firstname and a lastname"} }
Now the custom function that could be anywhere in your JS
function validate2fields(){ if($("#firstname").val() =="" || $("#lastname").val() == ""){ return true; }else{ return false; } }
Grab it here.
I like your script and started using it recently. Your new updates sound great…but I can’t seem to find where I can download v. 1.6.4. All I can find is still 1.6.3…
tarek
http://www.technotarek.com
Great. I like that.
Can you let me know what could be the custom rule regex expression that I could add to the engine for “The field must contain at least an alphabet and a number.”
Thanks in advance.
Zullu.
Added range[min,max] for numbers:
…
“length”: {
“regex”: “none”,
“alertText”: “• Between “,
“alertText2″: ” and “,
“alertText3″: ” characters allowed”
},
“range”: {
“regex”: “none”,
“alertText”: “• Numeric value between “,
“alertText2″: ” and “,
“alertText3″: ” allowed”
},
“maxCheckbox”: {
“regex”: “none”,
“alertText”: “• Checks allowed Exceeded”
},
…
and
function _range(caller, rules, position) { // VALIDATE RANGE
customRule = rules[position];
startRange = eval(rules[position + 1]);
endRange = eval(rules[position + 2]);
pattern = eval(“/^[0-9\ ]+$/”);//$.validationEngine.settings.allrules[customRule].regex);
if (!pattern.test($(caller).attr(‘value’))) {
$.validationEngine.isError = true;
promptText += $.validationEngine.settings.allrules[“range”].alertText + startRange + $.validationEngine.settings.allrules[“range”].alertText2 + endRange + $.validationEngine.settings.allrules[“range”].alertText3 + “”
}
else {
fieldValue = $(caller).attr(‘value’);
if (fieldValue endRange) {
$.validationEngine.isError = true;
promptText += $.validationEngine.settings.allrules[“range”].alertText + startRange + $.validationEngine.settings.allrules[“range”].alertText2 + endRange + $.validationEngine.settings.allrules[“range”].alertText3 + “”
}
}
}
…
case “length”:
_length(caller, rules, i);
break;
case “range”:
_range(caller, rules, i);
break;
…
Hope this helps
Hi – I’m new to the jquery – so maybe this has already been answered… But how would I use your validation plugin in a ‘Tab’ UI?
I’m testing now and when I switch to different tabs – the validation messages don’t change?
Thanks
Paul
rt
Thanks for this great plugin!
Most of the time I have no problems. Unfortunately, I am now faced with a form that uses a regular button instead of a submit button. Is there a way to trigger the validation process without a submit button?
Nevermind, figured it out!
var valid = $(“#formID”).validationEngine({returnIsValid:true});
Awesome plugin!
Upon upgrading, I get this error in jquery.validationEngine.js:
$(this).find(“[class*=validate][type!=checkbox]”).live is not a function
Any ideas? Thanks much!
Yes,
1.6.4 is only compatible with jquery 1.4 and up.
1.6.3 is still available for download
I have some problems in range function how can use it please help me as fast as possible
thanks for interest
Hello Cedric Dugas
I am very happy to get such a great jquery validation but I could not able to valide dropdown list why ?
is there any problem way to validater dropdown list ?
Please give some advice to solve it
Again thanks for your such great validation
I am trying to use your validation plugin along with a tabbing system I wrote, but I can’t get the tabbing to stop from going to the next step if there is an error generated from the form.
Any ideas on pointing me in the right direction for this?
if form select disabled=true then no error. How to solve.
why here is not any validation for dropdownlist how to add can you please suggest?
Hi, Cedric Dugas
Can I use the funcCall for an extra use for add several parameters in the function,thanks.
such as
I want to create a generic method to validate URLs
can i pass a parameter (in my case i need the element ‘this’) from the class definition?
or i need to write a method to each url field i want to validate and get the field value using jquery?
Thanks
Yes, I’d love to know if we can pass a value along in funcCall to determine what element was the trigger (having access to $(this) would be great).
Thanks,
Matt
it works well in localhost but when run in the bowser it shows….validateEngine is not a function..How to fix it??
sorry correction..NOT browser but when viewed online shows the error