Validation Problem in Rad Numeric TextBox

5 posts, 0 answers
  1. Akhil Raj
    Akhil Raj avatar
    69 posts
    Member since:
    Aug 2012

    Posted 01 Jun 2010 Link to this post

    hi,
      In edit form template of gridview i used radnumerictextbox. I validate the value using requiredfiled validator. My initial value is 0 and i set in the required field validator. How can i handle empty text. When i delete values in textbox and press update the validator not captured the error and i got the old value before the textbox used.

    How can i hablde this issue?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Jun 2010 Link to this post

    Hello,

    Try the following work-around and see whether it helps.

    aspx:
     
      <FormTemplate> 
            <asp:Button ID="Button2" runat="server" Text="Update" CommandName="Update" /> 
            <telerik:RadNumericTextBox  ClientEvents-OnBlur="OnBlur" ID="tbUnitPrice" runat="server" Value="0" EmptyMessage="0"
            </telerik:RadNumericTextBox> 
     
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="tbUnitPrice" 
                ErrorMessage="This field is required" InitialValue="0" runat="server" Display="Dynamic"
            </asp:RequiredFieldValidator> 


    javascript:
     
        function OnBlur(sender, args) { 
            if (sender.get_value() == "") { 
                sender.set_value("0"); 
            }     
        } 
     


    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Akhil Raj
    Akhil Raj avatar
    69 posts
    Member since:
    Aug 2012

    Posted 03 Jun 2010 Link to this post

    thanks friend... but i have a small issue regarding this method. when i delete the letters value reset to "0" correctly but the mouse is blinking...that feel ugly. any other method or any way to restrict that
  5. navalkishore
    navalkishore avatar
    2 posts
    Member since:
    Sep 2012

    Posted 06 Jan 2011 Link to this post

    This doesn't seem to work if we have validation group involved.
  6. Devinder
    Devinder avatar
    1 posts
    Member since:
    Mar 2011

    Posted 28 Mar 2011 Link to this post

    Yes it is not supported with validation group
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017