All pastes #371649 Raw Edit

Someone

public text v1 · immutable
#371649 ·published 2007-02-25 15:04 UTC
rendered paste body
/////////


IM trying to integrate bewteen jquery forms ( http://www.malsup.com/jquery/form/ ) 
and the validator plugin
http://jquery.bassistance.de/validate/demo-test/validate-demo.html

till now i dont have a clue why i its returns me errors... anyone can help?
///////

<!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="http://crazilla.linuxlab/js/jquery/jquery.js"></script>
<script type="text/javascript" src="http://crazilla.linuxlab/js/jquery/jquery.form.js"></script>
<script type="text/javascript" src="http://crazilla.linuxlab/js/jquery/jquery.block.js"></script>

<script type="text/javascript" src="http://crazilla.linuxlab/js/jquery/cmxforms.js"></script>
<script type="text/javascript" src="http://crazilla.linuxlab/js/jquery/metadata.js"></script>
<script type="text/javascript" src="http://crazilla.linuxlab/js/jquery/jquery.validate.js"></script>

</head>
<body>



<form name="amir" id="amir">
<label for="nm">asdsa</label><input name="nm"  type="text" id="nm" class="{required:true}"  >

<input type="submit" name="Submit" value="Submit">

</form>
<div id="reponse"></div>
</body>
</html>

<script>
    var options = {
        target:        '#reponse',   // target element(s) to be updated with server response
        beforeSubmit:  pre,  // pre-submit callback
        success:       post, // post-submit callback
		type:			'post',
		url: 'test2.php'
        // other available options:
        //url:       url         // override for form's 'action' attribute
        //type:      type        // 'get' or 'post', override for form's 'method' attribute
        //dateType:  null        // 'xml', 'script', or 'json' (expected server response type)
        //clearForm: true        // clear all form fields after successful submit
        //resetForm: true        // reset the form after successful submit

        // $.ajax options can be used here too, for example:
        //timeout:   3000
    };


    // bind form using 'ajaxForm'
    var v = $("#amir").validate({
    $('#amir').ajaxSubmit(options); }
function pre(formdata) {
	
	$.blockUI();
	if( !formdata.length ) {
		alert("Please fill out the form");
		return false;
	}
}
function post(response) {
	
	if( response.status != "error" ) {
		
		$("#reponse").html(reponse.message);
	} else {
		alert("Your form submission was not succesful");
	} $.unblockUI();
}





</script>