voltron escribió:
Hi,
I have a few questions:
1. Do you have examples that display the errors in another coantainer?
By default, the errors are display related to each field that not pass
the validation. You can
use errorPosition for to move the error in other place:
$("#myform").yav({errorPosition: parent().next("tr").html});
HTML (before)
<table>
<tr>
<td><label for="username">username</label></td>
<td><input type="text" id="username name="username"
class="required" title="this field is required"/></td>
<td></td>
</tr>
</table>
HTML (before)
<table>
<tr>
<td><label for="username">username</label></td>
<td><input type="text" id="username name="username"
class="required" title="this field is required"/></td>
<td><p class="error">this field is required</p></td>
</tr>
</table>
Also, more imaginative, using onError function, the error are displayed, so:
$("#myform").yav({
onError:function(){
$("#errorContainer").append($(".error")); //Append all the error
messages
$(".error").not($("#errorContainer .error")).remove(); //Remove
all the old errors but not in the errorContainer
}
});
2. Can one validate date formats form other countries like Germany?
This is a YAV config setting, by example Spain date format is
dd-MM-yyyy, so in the second map param
of the plugin I can set the YAV settings (see YAV reference):
$("#myform").yav({
onError:function(){
$("#errorContainer").append($(".error")); //Append all the error
messages
$(".error").not($("#errorContainer .error")).remove(); //Remove
all the old errors but not in the errorContainer
}
},
//Yav preferences in a second map object param
{
DATE_FORMAT: 'dd-MM-yyyy'
});
That is all!
Thanks
On Aug 9, 10:43 am, SeViR <[EMAIL PROTECTED]> wrote:
--
Best Regards,
José Francisco Rives Lirola <sevir1ATgmail.com>
SeViR CW · Computer Design
http://www.sevir.org
Murcia - Spain