RADNumericInput does not allow value to be set to empty

5 posts, 0 answers
  1. c0x3y
    c0x3y avatar
    3 posts
    Member since:
    Mar 2010

    Posted 09 Mar 2010 Link to this post

    We currently using the numeric textbox to allow users to enter some values.  The problem we are experiencing is when they decide that they no longer need to enter a value in the field and when they delete it and then the information is posted back the previous value is still in the field.

    Is there any way to set the value to empty on the numeric textbox?  I have tried doing it on an onblur method and using both the element.set_value("") and element._textBoxElement.value = "" but this does not seem to work?

    Thanks in advance for any help
  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 10 Mar 2010 Link to this post

    Using the OnBlur method you're using, if you want to clear the RadNumericTextbox and show an empty string, just call element.clear().

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. c0x3y
    c0x3y avatar
    3 posts
    Member since:
    Mar 2010

    Posted 10 Mar 2010 Link to this post

    Thanks for the help but it doesn't seem to work.

    I attached the script below to the OnBlur event for said box but it still retains the previous value.

     

    function ClearNumericTextBox(sender, args) {

     

     

    if (sender.get_value() == "")

     

        sender.clear();

    }

    Any other suggestions?

  5. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 11 Mar 2010 Link to this post

    Are you setting a default value for the RadNumericTextBox? The version I'm using is 2009.3.1314 and when you delete the value it clears it and it remains cleared when a postback occurs. Are you using the same version? Perhaps updating the controls will fix this issue your having.
  6. c0x3y
    c0x3y avatar
    3 posts
    Member since:
    Mar 2010

    Posted 12 Mar 2010 Link to this post

    Solved it.  I was doing something daft.

    Thanks for your help.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017