radiobuttonlist selected value and its validation
i have an form in which i ha开发者_Python百科ve radiolist and set of text boxes and dropdownlist.now when i check an radio some textboxes will be disabled and some text box will be enabled .now i want to validate only the enabled text box and not the disabled one. in the same manner when i check other radiobutton i want to validate the rest of the text boxes.can some body help please.
some one give me the validation code for that.
If you can use jQuery then you can get the enabled text boxes using
$("input[type='text']:disabled")
and the enabled text boxes using
$("input[type='text']:not(:disabled))
If you want to use simple javascript then you can get all the textboxes, then iterate through them, check the type
attribute for text
and check the disabled
attribute to true
or false
.
精彩评论