Can anybody help me? I am performing validation using jquery validation engine related existing file. Now I got the validation message that they have hard-coded in their existing file. I want to show some custom message without modifying the existing file. Can I implement custom error message with the existing jquery validation engine file or I have to go for my own implementation?
Asked
Active
Viewed 1,721 times
0
-
See this related post about overriding the default validation messages: http://stackoverflow.com/questions/2457032/jquery-validation-change-default-error-message – manaya Dec 12 '13 at 16:05
-
@manaya, that's for a different plugin. – Sparky Dec 12 '13 at 17:15
3 Answers
0
Honestly, it is so easy to write your own that if you wish custom messages, I would strongly endorse "rolling your own" solution.
Here is an example of a very simple validation to get you started. Note the use of an array arrAll
to hold the field names/descriptions that must be validated.
HTML:
One: <input type="text" id="f1"><br />
Two: <input type="text" id="f2"><br />
Three: <input type="text" id="f3"><br />
Four: <input type="text" id="f4"><br />
<br />
<input type="button" id="mybutt" value="Go" />
javascript/jQuery:
var chkFld, arrAll = {'One':'f1','Two':'f2','Three':'f3','Four':'f4'};
$('#mybutt').click(function() {
var errMsg='', badFlds='', firstBad='';
for(var key in arrAll){
chkFld = arrAll[key];
if ($('#'+chkFld).val() ==''){
//alert('Please complete field ' + arrAll[key] );
errMsg += '*' + chkFld + '\n';
if (firstBad=='') firstBad=chkFld;
}
}
if (errMsg != '') {
alert(errMsg);
$('#'+firstBad).focus();
}
}); //END mybutt.click
Here is another example: http://jsfiddle.net/J9wGx/3/
Note that the above solutions utilize jQuery, so you must reference the jQuery library in the document (usually in the <head>
tags), like this:
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>

cssyphus
- 37,875
- 18
- 96
- 111
0
Try Below Link.. May be You find what you want http://posabsolute.github.io/jQuery-Validation-Engine/

Bajid khan
- 57
- 5
0
I got the jQuery custom errors to work on my project. jQuery ValidationEngine Custom error messages
Good luck, deerhaq

Community
- 1
- 1

user3109555
- 3
- 1
-
Hi and welcome to Stack Overflow. Please note that while your answer remains here, the link and its content might change or be removed. Please edit your code to include the relevant information from that link. – Noich Feb 23 '14 at 07:41