In my asp.net (vb on server side) application I am using a required field validator when a submit button is hit. The validator checks the value of txtLatestEnd
- which is a hidden text box. The value of this text box is changed via javascript when the user selects an item on the screen before hitting submit.
I have noticed that the required field validator is only working in IE, but not chrome or firefox. Could anyone see why this is happening?
Required field validator
<asp:RequiredFieldValidator ID="reqLinks" Runat="server" ControlToValidate="txtLatestEnd" Display="Dynamic"
EnableClientScript="true" ErrorMessage="Links are required" CssClass="detailrow" Font-Bold="true"></asp:RequiredFieldValidator>
Edit
If it helps - here is the function on the server side that handles the button click
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
UpdateDatabase()
End Sub
and here is the button itself.
<asp:Button Runat="server" ID="btnSave" Text="Save Milestone" CssClass="smalltextbutton" CausesValidation="True"></asp:Button>
Both the validator and button are their own table rows in an asp.net table
Edit 2: as requested, here's the code for the "hidden" field - by hidden, it is inside a div that is not displayed
<div id="divHiddenFields" style="DISPLAY:none">
---------------Hidden Fields---------------------------------------------------<br>
Latest end date:<input type="text" ID="txtLatestEnd" Runat="server"><br>
IDs & Cats<input type="text" style="WIDTH:50%" runat="server" id="IDCATList"><br>
creator: <input type="text" runat="server" id="hdnCreator"><br>
county county<input type="text" runat="server" id="hdnLinkCount" value="0"><br>
preloadDateArray<input type="text" runat="server" id="hdnPreLoadDates">
</div>
I have also tried moving the button and validator outside of the table, this does nothing to make the validator work.