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

Display value on click.

1 Answer 66 Views
Input
This is a migrated thread and some comments may be shown as answers.
Damian
Top achievements
Rank 1
Damian asked on 11 Mar 2013, 08:35 AM
Hi,

I have the following scenario. There is a radtextbox(Read Only) in my account page that contains balance info. when user login, initially the textbox should display something like Click to show value. Once the user click inside the textbox, the amount in currency should be displayed. How to achieve the requirement?

Regards,
Damian.

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 11 Mar 2013, 09:14 AM
Hello Damian,

Please have a look into the following code I tried.

ASPX:
<telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" Culture="en-US"
    Type="Currency" Value="12345" ClientEvents-OnFocus="makeReadOnly" DisplayText="Click to see balance">
</telerik:RadNumericTextBox>
<br />
<telerik:RadTextBox ID="RadTextBox2" runat="server"></telerik:RadTextBox>

JavaScript:
<script type="text/javascript">
    function makeReadOnly(sender, args) {
        $get("<%=RadNumericTextBox1.ClientID %>").readOnly = true;
        document.getElementById("RadTextBox2").focus();
    }
</script>

Thanks,
Princy.
Tags
Input
Asked by
Damian
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or