问题描述:

I have a fluid form. I validate my form using the jQuery validate plugin. But on submit I get an error

TypeError: elem is undefined

My code:

<f:form id="user_form">

<table>

<tr>

<th><f:translate key="email" /></th><td></td>

</tr>

<f:for each="{users}" as="user">

<tr>

<td> <a class="editable" id="email" data-validation="email" data-validation-error-msg="You did not enter a valid e-mail">{user.email} </a></td><td></td>

</tr>

</f:for>

</table>

</f:form>

jquery.js

$('#user_form').validate({

form : '#user_form',

modules : 'location, date, security, file',

validateOnBlur : false,

errorMessagePosition : 'top',

scrollToTopOnError : false,

onModulesLoaded : function() {

console.log("Load jquery validates");

}

});

The following script is included in my header

<script src="//code.jquery.com/jquery.js" type="text/javascript"></script>

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.23/jquery.form-validator.min.js" type="text/javascript"></script>

相关阅读:
Top