I have a long page with lots of fields. User has to scroll up and down. This is an Apply-For-A-Job page. I have Personal Info, resume, employer, etc sections.
I have those sections wrapped in an UpdatePanel.
*** For required fields, I have the RequiredFieldValidator. Displays a star next to each required field when it's missing.
At the bottom of the page, I have a submit button. It is NOT wrapped in an updatePanel.
*** This is what happens; when I click submit, Page doesnt go to the top ( I dont think it posts back) , I have to scroll up and then see the validator's "red stars" for missing fields.
*** This is what I want to do: When clicking submit,
a. I want the page to post back ( i have the submit button outside UpdatePanel),
b. ***go to the top of the page ***
c. Still show validator's red stars
d. Display a list of fields that were missing inline, on the page.
I think having the requiredFieldValidators is preventing the page from posting back and going to the top of the page. If I remove them, then I think i have to do *the validation in the code-behind* and display the error msg in a label something on top of the page. But then,i think i also have to display the requiredfieldvalidator red-star dynamically... OR do I need to have a validationGroup for all the validators on the page?
What to do?
<asp:Button runat="server" CssClass="formBUTTON" ID="btnSumbit"
Text="Submit Application" Enabled="false" tabindex="71" onclick="btnSumbit_Click" />
//textbox with validator
<asp:TextBox runat="server" ID="txtFirst_name" CssClass="formFIELD" TabIndex ="1"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtFirst_Name" ErrorMessage="First Name" Text="*" runat="server"/>