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

RADNumericInput does not allow value to be set to empty

4 Answers 196 Views
Input
This is a migrated thread and some comments may be shown as answers.
c0x3y
Top achievements
Rank 1
c0x3y asked on 09 Mar 2010, 05:08 PM
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

4 Answers, 1 is accepted

Sort by
0
robertw102
Top achievements
Rank 1
answered on 10 Mar 2010, 04:14 PM
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.
0
c0x3y
Top achievements
Rank 1
answered on 10 Mar 2010, 04:36 PM
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?

0
robertw102
Top achievements
Rank 1
answered on 11 Mar 2010, 04:16 PM
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.
0
c0x3y
Top achievements
Rank 1
answered on 12 Mar 2010, 11:22 AM
Solved it.  I was doing something daft.

Thanks for your help.
Tags
Input
Asked by
c0x3y
Top achievements
Rank 1
Answers by
robertw102
Top achievements
Rank 1
c0x3y
Top achievements
Rank 1
Share this question
or