<input id="j_id0:mainFormId:selected:selectedProductsDiv:3:quantityId" name="j_id0:mainFormId:selected:selectedProductsDiv:3:quantityId" type="text">
How do I attach jquery validator rule for the above field? All the examples are showing that we need to simply put the name attribute but in my case the name attribute keeps changing but it always ends with quantityId..
j$('form[id$="mainFormId"]').validate({
rules: {
$quantityId : "required"
}
});
Any suggestions?
addMethodand use the method name as a class also