[jQuery] How Do i Assign error div to JQuery Validator Plugin Alpha 2 ?
hey, i got the following code (i fixed the ie6 bugs and stuff)
now i need to figure out how can i assign the div the shows errors in each
input? i saw the demos but the problem is that i want to control on each div
position with my css.. .is that possible ? or anyone can shows me how to do
it in diffrent way that i will able to control the positions on each error
div?
(i mean the "<div id="password-errordiv">please enter password</div>"
divs'...)
ill be glad if someone will paste me a demo into this code or similar
thanks
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript" src="jquery/jquery.form.js"></script>
<script type="text/javascript" src="jquery/jquery.block.js"></script>
<script type="text/javascript" src="jquery/cmxforms.js"></script>
<script type="text/javascript" src="jquery/metadata.js"></script>
<script type="text/javascript" src="jquery/val.js"></script>
<script type="text/javascript">
function pre(formdata) {
$("#ab").html('loading');
}
function po(response) {
var response = eval('('+ response +')');
if( response.status != "error" ) {
statusmsg = "Thanks for the submit";
} else {
statusmsg = "Your form submission was not succesful";
}
$("#ab").html(response.data );
}
var options = {
beforeSubmit: pre, // pre-submit callback
success: po, // post-submit callback
type: 'post',
url: 'test2.php'
};
$(document).ready(function() {
// bind form using 'ajaxForm'
$("#amir").validate({
submitHandler: function(form) {
$(form).ajaxSubmit(options);
}
});
});
</script>
</head>
<body>
<form name="amir" id="amir" class="amir">
<label for="password">password</label>
<input name="password" type="text" id="password" >
<div id="password-errordiv">please enter password</div>
<label for="firstname">firstname</label>
<input name="firstname" type="text" id="firstname" >
<div id="firstname-errordiv">Please fill the name!</div>
<input type="submit" name="Submit" value="Submit">
</form><div id="ab">sdsd</div>
</body>
</html>
--
View this message in context: http://www.nabble.com/How-Do-i-Assign-error-div-to-JQuery-Validator-Plugin-Alpha-2---tf3342587.html#a9296307
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/