My first attempt at asking this didn't go well. So, I am trying again, with hopefully more/better details.
I am running into this exact same problem:
RequiredFieldValidator have to click twice
RequiredFieldValidator requires user to click twice
When using a RequiredFieldValidator attached to a textbox, it is necessary to click twice to move focus to the next (or any) control. I understand the reason given in the above posts. But as one of the authors says, "I don't want to have to click twice". I've tried the suggestions in the post, but so far nothing is working.
Has anyone figured out another way to work around this?
I have tried:
EnableClientScript="False"Display="Static"(had this already because it is my preference)Page.Validate();andPage.Validate("vgPage04");called fromPage_Load(bothIsPostBackand!IsPostBack)ErrorMessageandTextproperties are populated- Placing the
ErrorMessagein both the property and between the tags CausesValidation="true"on the textbox- Using a regular ASP.NET textbox instead of Telerik RadTextBox
- I do not have a
CompareValidator - A
CustomValidatorusing server validation has the same problem - A
CustomValidatorusing client validation causes a different problem, so I don't want to go there
By design, it is allowable for the user to move to the next page of the application when there are invalid fields. Invalid fields need to be completed before a final submit on a subsequent page, but not to just move to the next page.
My code is as follows:
<telerik:RadTextBox ID="txtSample" runat="server" AutoPostBack="true"
RenderMode="Lightweight" style="max-width:none;"
Resize="None" Width="330px" >
</telerik:RadTextBox>
<asp:RequiredFieldValidator ID="valSample" runat="server"
ControlToValidate="txtSample" ValidationGroup="vgPage04"
EnableClientScript="False" Display="Static"
CssClass="cssRF_splat"
Text="*" ErrorMessage="Sample" >
</asp:RequiredFieldValidator>
On both IsPostBack and !IsPostBack, Page_Load calls
Page.Validate();
Thanks!