Chaitanya Purandare
Chaitanya Purandare

Reputation: 5

Required field validator Submit issue

I have a web form (say form 1) created for a small dine-in with a submit button. The fields to be validated are Name (textbox) gender(radio button) and so on. below this form on the same page is a feedback form (say form 2) having two fields: name(textbox) and feedback(text area). The feedback form has a submit button.

PROBLEM: When submit button of feedback form is clicked feedback is not submitted due to the required fields in form 1 are not filled in.

I want the feedback to be submitted. Please help.

image of the problem: https://www.dropbox.com/s/97tuva03bl33xur/form.PNG?dl=0

Upvotes: 0

Views: 1698

Answers (2)

Genish Parvadia
Genish Parvadia

Reputation: 1455

Use ValidationGroup use this code

 <asp:TextBox ID="TxtAreaName" runat="server"></asp:TextBox>
     <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
          ControlToValidate="TxtAreaName" ErrorMessage="*" ValidationGroup="a"></asp:RequiredFieldValidator>

<asp:Button ID="btnSubmit" OnClick="btnSubmit_OnClick" Text="Submit" ValidationGroup="a" runat="server" />

Upvotes: 2

صفي
صفي

Reputation: 1068

Use same ValidationGroup for each form.

Upvotes: 0

Related Questions