if(data == 0){ jQuery("#commentPosted").addClass("error").html(" <%= XsltLibrary.Dictionary("#CommentFailend","Your comment could not be posted, we're very sorry for the inconvenience") %> "); jQuery("#commentform").show(); jQuery("#commentform #submit").attr("enabled", true); } }); } }); });
How do I add a validation group to UComment?
Hi!
I have Ucomment on a page and I also have another form to submit and email address for a news letter.
My Newsletter submit has its own standard .net required field validator and I have set the validation group of the validator and button.
My problem is my news letter button is also firing the validation of UComment so my newsletter won't submit.
Can I get round this by somehow adding a validation group?
Bex
Have worked out what I need to do.
The problem was that any submit button on the page was causing validation and submitting my comments.
I have made a slight tweak to the UCommentForm usercontrol.
I have updated the validation scrip in the jQuery so that the validate function is performed within the click event of the button. So it now reads:
$("#submitButton").click(function(){jQuery("#frmComment").validate({
submitHandler: function(form) {jQuery("#commentform").hide();
jQuery("#commentLoading").show();
jQuery("#commentform #submit").attr("enabled", false);
function(data){jQuery("#commentLoading").hide();jQuery("#commentPosted").show().removeClass("error");
if(data == 0){jQuery("#commentPosted").addClass("error").html(" <%= XsltLibrary.Dictionary("#CommentFailend","Your comment could not be posted, we're very sorry for the inconvenience") %> ");
jQuery("#commentform").show();
jQuery("#commentform #submit").attr("enabled", true);
}
});
}
});
});
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.