This is a migrated thread and some comments may be shown as answers.

RequiredValidator in InlineInsertTemplate

1 Answer 44 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Diego
Top achievements
Rank 1
Diego asked on 20 Sep 2012, 04:21 PM
Hello, 
I'm creating a Custom InlineInsertTemplate and I have to add some RequiredValidator for some fields inside form as follow bellow:

<InlineInsertTemplate>
                                    <telerik:RadTextBox runat="server" ID="txtContato" ValidationGroup="1" CssClass="text-box single-line ui-corner-all">
                                    </telerik:RadTextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="1" 
                                    ControlToValidate="txtContato" Display="Dynamic" ErrorMessage="Campo obrigatório." ForeColor="Red">
                                    </asp:RequiredFieldValidator>
<telerik:RadButton ID="btnSave" CausesValidation="true" ValidationGroup="1" CommandName="Insert" Text="Salvar" runat="server"></telerik:RadButton>
</InlineInsertTemplate>
 

But when I click in my save button, the form cause an postback and not validate my form.

How I do to solve this problem?

Best Regards,

Diego Oliveira

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Sep 2012, 04:08 AM
Hi Diego,

Try setting CausesValidation as false for the RadButton.
aspx:
<telerik:RadButton ID="btnSave" CausesValidation="false" ValidationGroup="1" CommandName="Insert" Text="Salvar" runat="server"></telerik:RadButton>

Thanks,
Shinu.
Tags
Scheduler
Asked by
Diego
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or