Hi!
I'm really confused as to why my RequiredFieldValidators are not working. Basically I have .aspx page that is being used as a RadWindow-- A kind of edit dialog. On that page is a User Control (.ascx) that has a panel with my RadTextBoxes and submit button. I'm trying to setup
RequiredFieldValidators on those textboxes but cannot figure out why they are not firing when I click the button. Here is the panel in question. What am I doing wrong? Thanks!
I'm really confused as to why my RequiredFieldValidators are not working. Basically I have .aspx page that is being used as a RadWindow-- A kind of edit dialog. On that page is a User Control (.ascx) that has a panel with my RadTextBoxes and submit button. I'm trying to setup
RequiredFieldValidators on those textboxes but cannot figure out why they are not firing when I click the button. Here is the panel in question. What am I doing wrong? Thanks!
<
telerik:RadFormDecorator
ID
=
"RadFormDecorator1"
runat
=
"server"
DecoratedControls
=
"All"
Skin
=
"Web20"
></
telerik:RadFormDecorator
>
<
asp:Panel
ID
=
"StatesEditPanel"
CssClass
=
"maintext"
BackColor
=
"#FFFFFF"
runat
=
"server"
>
<
asp:Label
ID
=
"lblStatesHeader"
runat
=
"server"
Font-Bold
=
"True"
></
asp:Label
><
br
/>
<
table
id
=
"StatesTable"
border
=
"0"
cellspacing
=
"1"
cellpadding
=
"2"
width
=
"100%"
>
<
tr
>
<
td
style
=
"font-weight: bold; text-align: right; vertical-align: middle;"
>
State Abbreviation:
</
td
>
<
td
style
=
"text-align: left;"
>
<
telerik:RadTextBox
ID
=
"rtxtStateAbbrev"
runat
=
"server"
Width
=
"10%"
EmptyMessage
=
""
Skin
=
"Web20"
Font-Size
=
"9pt"
BackColor
=
"#fdf5e6"
MaxLength
=
"2"
SelectionOnFocus
=
"SelectAll"
ValidationGroup
=
"lookupedit"
/>
<
asp:RequiredFieldValidator
ID
=
"StateAbbrevRequiredFieldValidator"
runat
=
"server"
ControlToValidate
=
"rtxtStateAbbrev"
Display
=
"Dynamic"
InitialValue
=
" ---"
EnableClientScript
=
"true"
ErrorMessage
=
"You must enter a State Abbreviation!"
Font-Size
=
"7pt"
ForeColor
=
"Red"
ValidationGroup
=
"lookupedit"
Font-Bold
=
"true"
/>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight: bold; text-align: right; vertical-align: middle;"
>
Description:
</
td
>
<
td
style
=
"text-align: left;"
>
<
telerik:RadTextBox
ID
=
"rtxtStateName"
runat
=
"server"
Width
=
"40%"
Skin
=
"Web20"
Font-Size
=
"9pt"
BackColor
=
"#fdf5e6"
MaxLength
=
"10"
ValidationGroup
=
"lookupedit"
/>
<
asp:RequiredFieldValidator
ID
=
"StateDescriptionRequiredFieldValidator"
runat
=
"server"
ControlToValidate
=
"rtxtStateName"
EnableClientScript
=
"true"
Display
=
"Dynamic"
InitialValue
=
" ---"
Text
=
"You must enter a Description!"
Font-Size
=
"7pt"
ForeColor
=
"Red"
ValidationGroup
=
"lookupedit"
Font-Bold
=
"true"
/>
</
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight: bold; text-align: right; vertical-align: middle;"
class
=
"style1"
>
Tax Rate:
</
td
>
<
td
style
=
"text-align: left;"
class
=
"style1"
>
<
telerik:RadTextBox
ID
=
"rtxtStateTaxRate"
runat
=
"server"
Width
=
"20%"
EmptyMessage
=
""
Skin
=
"Web20"
Font-Size
=
"9pt"
BackColor
=
"#fdf5e6"
MaxLength
=
"10"
SelectionOnFocus
=
"SelectAll"
CausesValidation
=
"True"
ValidationGroup
=
"lookupedit"
/>
<
asp:RequiredFieldValidator
ID
=
"StateTaxRateRequiredFieldValidator"
runat
=
"server"
ControlToValidate
=
"rtxtStateTaxRate"
Display
=
"Dynamic"
InitialValue
=
" ---"
EnableClientScript
=
"true"
ErrorMessage="<br />You must enter a State Tax Rate!" Font-Size="7pt" ForeColor="Red"
Font-Bold="true" ValidationGroup="lookupedit" />
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"2"
style
=
"text-align: center;"
>
<
asp:Button
ID
=
"btnStatesSave"
runat
=
"server"
Font-Bold
=
"True"
Text
=
"Save"
CausesValidation
=
"true"
Width
=
"80px"
ValidationGroup
=
"lookupedit"
/>
<
asp:Button
ID
=
"btnStatesDelete"
runat
=
"server"
Font-Bold
=
"True"
Text
=
"Delete"
CausesValidation
=
"true"
Width
=
"80px"
/>
</
td
>
</
tr
>
</
table
>
</
asp:Panel
>