Side navigation
#7507 closed bug (invalid)
Opened November 14, 2010 10:47AM UTC
Closed November 14, 2010 02:02PM UTC
Custom validation does not work test method undefined
| Reported by: | kris.nobels@gmail.com | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.5 |
| Component: | unfiled | Version: | 1.4.2 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
Hello,
I created a custom validation like this
<script type="text/javascript">
141 $(
142 function () {
143 $('#uiGSMnrs').focus();
144
145 jQuery.validator.addMethod(
146'regex',
147function(value, element, regexp) {
148return this.optional(element) || regexp.test(value);
149},
150'Waarde niet geldig'
151);
152
153$('#SMSForm').validate({
154 rules: {
155 uiGSMnrs:{
156 required: true,
157 minlength: 10,
158 regex: '^([+]?[0-9]{10,14}[;]?)+$'
159 },
160 uiBericht:{
161 required: true,
162 maxlength: 160
163 }
164 },
165 messages: {
166 uiGSMnrs:{
167 required: 'Verplicht veld',
168 minlength: 'Minimum 10 charaters vereist',
169 regex: 'Waarde niet geldig'
170 },
171 uiBericht:{
172 required: 'Verplicht veld',
173 maxlength: 'Maximum 160 charaters vereist'
174 }
175 }
176});
177 }
178);
179 </script>
But the result is that the validation is not working at all. :-(
You can see a screenshot from firebug here
http://lh3.ggpht.com/_G2Zw9Fyi6WM/TN-9OguZonI/AAAAAAAABOc/2-ggUz1heRs/s1600/Jqueryvalidation.png
I use jQuery validation plug-in 1.7
with
jQuery JavaScript Library v1.4.2
Please contact me kris.nobels[at]gmail.com
Attachments (0)
Change History (1)
Changed November 14, 2010 02:02PM UTC by comment:1
| resolution: | → invalid |
|---|---|
| status: | new → closed |
This is not a jQuery core bug. Please ask for help on the forum.