Display value on click.

2 posts, 1 answers
  1. Damian
    Damian avatar
    21 posts
    Member since:
    Mar 2013

    Posted 11 Mar 2013 Link to this post

    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.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Mar 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top