Good Day,
I'm using an ASP.NET Repeater control to create rows of textboxes. I'm able to capture the value of the textboxes, but I would like to validate that all the textboxes have a value inside.
Is this possible to do in jQuery?
TIA,
coson
Good Day,
I'm using an ASP.NET Repeater control to create rows of textboxes. I'm able to capture the value of the textboxes, but I would like to validate that all the textboxes have a value inside.
Is this possible to do in jQuery?
TIA,
coson
Sure it is.
$(".submit-button").click(function() {
$("class-or-id-of-repeater").find("input[type=text]").each(function() {
if($.trim($(this).val()) == '') {
alert("At least one textbox is empty");
$(this).focus(); // focus the element
}
})
});
If you create Dynamic Controls in ASP.NET, the textboxes will still be rendered on the page after the postback.
I haven't tested this using an UpdatePanel, it might break if you used one.