We have a textbox which can be disabled and prefilled based on the radio button selection.
The issue which we are facing is:
Initially the control is open and editable and when we click submit button on the page, the control is getting validated and the error messages appear next to the control
At this time if the user clicks the radio button which prefills it and disables it, the error message still appears next to the control, which is not a good user experience.
Could this error message be cleared when the radio button is clicked to disable the control ?
I am using the jQuery validation plugin, but the responses seem to be for the asp.net validation controls.
Raju,
I did go through the link you provided. Currently also when the controls are disabled, the validations are not firing on button click, which is correct. But what i am looking for is just to clear of the messages when the control is disabled.
I have also posted this question in the jQuery forums as well.
manojrockz
Member
108 Points
86 Posts
Clearing Validation Error Messages when the control is disabled : jQuery Validation Plugin
Nov 27, 2012 12:30 PM|LINK
Hi all,
We have a textbox which can be disabled and prefilled based on the radio button selection.
The issue which we are facing is:
Initially the control is open and editable and when we click submit button on the page, the control is getting validated and the error messages appear next to the control
At this time if the user clicks the radio button which prefills it and disables it, the error message still appears next to the control, which is not a good user experience.
Could this error message be cleared when the radio button is clicked to disable the control ?
Thanks in advance.
Regards,
Manoj C S
msmk
Participant
776 Points
158 Posts
Re: Clearing Validation Error Messages when the control is disabled : jQuery Validation Plugin
Nov 27, 2012 03:24 PM|LINK
Try myField.errorString = "";
Good Luck
Ruchira
All-Star
42888 Points
7020 Posts
MVP
Re: Clearing Validation Error Messages when the control is disabled : jQuery Validation Plugin
Nov 27, 2012 04:24 PM|LINK
Hello,
Yeah. You can use the below code to disable the validation.
ValidatorEnable(document.getElementById('<%=ValidatorID.ClientID%>'), false);
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.deepak.jena
Member
18 Points
3 Posts
Re: Clearing Validation Error Messages when the control is disabled : jQuery Validation Plugin
Nov 27, 2012 05:15 PM|LINK
You can disable the validation , on the radio button check changed event using jQuery (if checked)
asteranup
All-Star
30184 Points
4906 Posts
Re: Clearing Validation Error Messages when the control is disabled : jQuery Validation Plugin
Nov 28, 2012 03:33 AM|LINK
Hi,
You can check this-
http://stackoverflow.com/questions/400346/disable-asp-net-validators-with-javascript
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
raju dasa
Star
14320 Points
2440 Posts
Re: Clearing Validation Error Messages when the control is disabled : jQuery Validation Plugin
Nov 28, 2012 05:25 AM|LINK
Hi,
check this site to enable/disable jquery validation on an element:
http://stackoverflow.com/questions/12176205/disable-validation-for-an-element-with-jquery-unobtrusive-validation
rajudasa.blogspot.com || blog@opera
manojrockz
Member
108 Points
86 Posts
Re: Clearing Validation Error Messages when the control is disabled : jQuery Validation Plugin
Nov 29, 2012 01:36 PM|LINK
Thank you all very much for replying.
I am using the jQuery validation plugin, but the responses seem to be for the asp.net validation controls.
Raju,
I did go through the link you provided. Currently also when the controls are disabled, the validations are not firing on button click, which is correct. But what i am looking for is just to clear of the messages when the control is disabled.
I have also posted this question in the jQuery forums as well.
http://forum.jquery.com/topic/clearing-validation-error-messages-when-the-control-is-disabled-jquery-validation-plugin#14737000003713107
I will try for options and let you know.
Thanks very much.
Regards,
Manoj C S