I always get error
Uncaught TypeError: Cannot call method 'call' of undefined
when I type correct email in my form. Custom massages doesn't work too.
Function ?module=auth&action=registration work properly (it returns string 'false' or 'true').
I use this plugin: JQuery Validation Plugin .
I think problem is in these files below.
custom.validation.js:
$(document).ready(function() {
$("#reg").validate({
rules: {
'u1[firstName]': "required",
'u2[firstName]': "required",
'u1[lastName]' : "required",
'u2[lastName]' : "required",
'u1[email]' : {
"required" : true,
"email" : true,
"remote" : {
url: '?module=auth&action=checkemail',
type: "post",
data:
{
'u1[email]': function()
{
console.log($("#email1").val());
return $("#email1").val();
}
}
},
'u2[email]' : "required"
},
messages: {
'u1[firstName]': {
required: "My requied text"
}
}
}
});
});
and form:
<fieldset>
<label for="imie" >Name:</label>
<input type="text" name="u1[firstName]"{if $smarty.post.u1.firstName} value="{$smarty.post.u1.firstName}"{/if}>
<label for="nazwisko" >Lastname:</label>
<input type="text" name="u1[lastName]" {if $smarty.post.u1.lastName} value="{$smarty.post.u1.lastName}"{/if}>
<label for="adresEmail">E-mail:</label>
<input type="text" name="u1[email]" id="email1" {if $smarty.post.u1.email} value="{$smarty.post.u1.email}"{/if}>
</fieldset>
<fieldset>
<button type="submit">Send</button>
</fieldset>
u2fields? Also, would be better to post the rendered HTML as that's the only thing the client-side code it going to see/use.