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

RequiredFieldValidator validating incorrectly on RadComboBox

4 Answers 256 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 25 Mar 2011, 05:29 AM
Hi I have a RadCombobox control, and a requiredFieldValidator that validates it for empty text.
The thing is that when I tried to key in any text, it gives me the validation error (instead of the other way round). So when I typed in "testing" it prompts the error. When I removed it, it is still there.
The error will not disappear until I tried to select one of the item inside the dropdownlist.
Anyone had any idea?

Below is my aspx code:

<telerik:RadComboBox ID="radProcessLn" runat="server" AllowCustomText="true" EnableScreenBoundaryDetection="False" EmptyMessage="Insert/select" />
<asp:RequiredFieldValidator ID="rfvProcessLn" ControlToValidate="radProcessLn" ErrorMessage="Please enter Process Ln / Operation" InitialValue="" ValidationGroup="Submit" CssClass="mandatory" runat="server"Display="Dynamic" />

Update: Tested it out on Google Chrome, IE8, and IE7 and the validation is working just fine. But it's not in IE9.

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Mar 2011, 08:31 AM
Hello Karl,

As a work around, you can try using CustomValidator instead of RequiredFieldValidator. Please go through the following help article for more on this.
Validate Combobox by Value

Thanks,
Shinu.
0
Ravinder
Top achievements
Rank 1
answered on 31 Oct 2013, 10:18 AM
Hi, I am using RequiredField Validator for RadComboBox,but it is working fine for the first time,if i go back and click it will again asking,
it should not like that.How I can achieve   

 

 

 

 

     

 

 

 

 

   

 

 

 

 

     

 

 

 

 

     

  

 
 

 

0
Shinu
Top achievements
Rank 2
answered on 01 Nov 2013, 09:49 AM
Hi Ravinder,

Please take a look into the following code snippet I tried where the RequiredField Validator for RadComboBox works as expected.

ASPX:
<telerik:RadComboBox ID="RadComboBox1" runat="server" EmptyMessage="select">
    <Items>
        <telerik:RadComboBoxItem Text="Item1" runat="server" />
        <telerik:RadComboBoxItem Text="Item2" runat="server" />
        <telerik:RadComboBoxItem Text="Item3" runat="server" />
    </Items>
</telerik:RadComboBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="RadComboBox1">
</asp:RequiredFieldValidator>
<telerik:RadButton ID="RadButton1" runat="server" Text="Confirm" OnClick="RadButton1_Click">
</telerik:RadButton>

C#:
protected void Page_Load(object sender, EventArgs e)
{
    Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
protected void RadButton1_Click(object sender, EventArgs e)
{
    Response.Redirect("Removeitem.aspx");
}

Thanks,
Shinu.
0
Bilawal
Top achievements
Rank 1
answered on 03 Oct 2014, 07:42 AM
Wow its work for me thanks man :)
Tags
ComboBox
Asked by
Karl
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ravinder
Top achievements
Rank 1
Bilawal
Top achievements
Rank 1
Share this question
or