1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / clearing text inside textbox

clearing text inside textbox

4 posts, 0 answered
  1. Zahid Ali
    Zahid Ali avatar
    47 posts
    Registered:
    16 Nov 2009
    08 Dec 2009
    Link to this post
    Hi,

    I have added a newsletter control and have bit of pre-populated text 'enter email...'.

    I want the text to clear up when the field is focused.

    What is SF's best practice approach to achieve this?

    thanks.

    Zahid
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    08 Dec 2009
    Link to this post
    Hi Zahid Ali,

    You should find the control in the physical files, it should be a user control. Then find the textbox and add something like javascript on the client side OnClick event. Here is some article on that - http://www.velocityreviews.com/forums/t86278-how-to-implement-an-onclick-on-asp-textbox.html

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Zahid Ali
    Zahid Ali avatar
    47 posts
    Registered:
    16 Nov 2009
    08 Dec 2009
    Link to this post
    Hi Georgi,

    I would've done via jQuery to keep things clean and consistent but I was wondering if there is a recommended approach by SF.

    thanks.

    Zahid
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    08 Dec 2009
    Link to this post
    Hi Zahid Ali,

    jQuery is also a good solution for this. There is no recommended way for this as it involves dealing with regular ASP.NET controls. I guess jQuery is cleaner though.


    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered