|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Validator for checkbox is not getting triggered alwayscheckbox.In the validator class I have attached the javascript fuction called AtleastOneChkBoxValidatorIsValid and in controlsTocheck I pass the name for the checkbox in the group that need to validate as follows Protected Overrides Sub AddAttributesToRender(ByVal writer As System.Web.UI. HtmlTextWriter) MyBase.AddAttributesToRender(writer) If Me.RenderUplevel writer.AddAttribute("evaluationfunction", "AtleastOneChkBoxValidatorIsValid") writer.AddAttribute("controlstocheck", ControlsToCheck) End If End Sub The problem I am facing is that whenever the validator gets firred the error message is displayed but whenever I click a checkbox the error message should go off but the error message is still displayed on the page it goes off after I click 2nd or 3rd checkbox.the reason for this is that the method AtleastOneChkBoxValidatorIsValid is not triggered always when a checkbox is checked. Where are you getting the value for ControlsToCheck? You need to be sure to
use the GetControlRenderID method of the BaseValidator when determining the value for ControlsToCheck. Do a View Source in your browser to make sure the ID of the CheckBox is what you think it is. We may also be able to help you more if you post your code as well. Good Luck! Show quoteHide quote "shilpakalbhor" <u48653@uwe> wrote in message news:8fd4d3db5f803@uwe... >I have a validator class that extend baseValidator class applied to a > checkbox.In the validator class I have attached the javascript fuction > called > AtleastOneChkBoxValidatorIsValid and in controlsTocheck I pass the name > for > the checkbox in the group that need to validate as follows > > Protected Overrides Sub AddAttributesToRender(ByVal writer As > System.Web.UI. > HtmlTextWriter) > MyBase.AddAttributesToRender(writer) > If Me.RenderUplevel > writer.AddAttribute("evaluationfunction", > "AtleastOneChkBoxValidatorIsValid") > writer.AddAttribute("controlstocheck", ControlsToCheck) > > End If > End Sub > > The problem I am facing is that whenever the validator gets firred the > error > message is displayed but whenever I click a checkbox the error message > should > go off but the error message is still displayed on the page it goes off > after > I click 2nd or 3rd checkbox.the reason for this is that the method > AtleastOneChkBoxValidatorIsValid is not triggered always when a checkbox > is > checked. >
Check for table
Adapting ReorderList WebControl for rendering dynamic html SelectCommand with SelectParameters.Add UpdateProgress animated gif freezes in ajax postback RE: Gridview templaye button control Re: FTP download RE: SelectCommand with SelectParameters.Add Re: Databinding Syntax Not Working in ListView LayoutTemplate Test for table in database Master/Detail Page. |
|||||||||||||||||||||||