Jqueyr validation

Jqueyr validation


Hi,

I am using jQuery validation for my forms( http://jqueryvalidation.org/). I have a problem that names are viloating.

Remove, add Rules also not working

Can i use id to define rule? Please prvoide me an example?

<script language="javascript" type="text/javascript">
$(document).ready(function (data){
$(\'form[name='.$data['form'].']\').validate({
// Rules for add new product javascript include
rules:{
sprice:{
max:$(\'#sprice\').val() -1
},
lprice:{
max : $(\'#lprice\').val() - 1,
greaterThan:\'#sprice\'
},
lpriceS:{
greaterThan:\'#spriceS\'
},
lpriceS:{
greaterThan:\'#spriceS\'
},
available_quantity:{
lessThanOrEqual:\'#lowest_price\'
},
password:{
required: true,
minlength: 8,
mypassword: true
},
email:{
email:true,
remote: {
url:\''.$emailCheckUrlForRegister.'\',
type: "post",
data:{
email: function(){
return $(\'#registration_supplier :input[name="email"]\').val()
}
}
}
}
},
messages:{
lprice:{
max:"Please enter a value less than $"+$(\'#lprice\').val(),
greaterThan: "This field is less than starting price"
},
available_quantity:{
lessThanOrEqual:"This field greater than or equal to requested quantity for lowest price"
},
password:{
mypassword:"Password must contain a capital or simple letter"
},
email:{
remote:"Email is not available"
},
sprice:{
max:"Please enter a value less than $"+$(\'#sprice\').val()
},
lpriceS:{
greaterThan:"This field is less than starting price"
}
},

 

"lprice" is causing the issue. i changed the name to  lpriceS. but i dont like this.
Pls advice