Panos
asked on
Jquery validation by class
Hello experts.
I need help to validate a form in a modal window by classname using jquery validation plugin.
My form is id="formcategories"
My required textfields : class="categoryclass"
If one of the textfields doesn't pass the validation - add to this class error (like i would handle this with id validation)
Attached my code
Any help?
I need help to validate a form in a modal window by classname using jquery validation plugin.
My form is id="formcategories"
My required textfields : class="categoryclass"
If one of the textfields doesn't pass the validation - add to this class error (like i would handle this with id validation)
Attached my code
var editcategory = function(id){
var p = $("#popuploader");
p.dialog({
autoOpen: false,
width: 300,
height: 300
});
p.dialog({
buttons: {
"Save": function () {
var targetUrl = "index.cfm";
var b = $("#formcategories");
var a = b.valid();
if (a) {
var f = b.serialize();
$.post("actions/actupdate.cfm", f, function (g) {
if (g) {
window.location.href = targetUrl;
}
})
}
},
"Cancel": function () {
$(this).dialog("close");
$(this).dialog("destroy");
}
}
});
p.dialog("open");
p.load("forms/frmtext.cfm?categoryid=" + id, function (c, e, d) {
if (e == "success") {
$("#formcategories").validate({
}
)
} else {
alert("errorload")
}
});
};
Any help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Finally i got it.
Thank you for your help
Thank you for your help
ASKER
thank you
regards
panos
regards
panos
ASKER
where do i have to place this code inside my script so that the form will be validated on:
var a = b.valid();