Set text from the client side.

4 posts, 0 answers
  1. ACubukcu
    ACubukcu avatar
    9 posts
    Member since:
    Oct 2005

    Posted 01 Feb 2013 Link to this post

    Is thre a way to set the search box text from the client side?
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 01 Feb 2013 Link to this post

    Hi,

    Yes, you can use the client-side set_emptyMessage property. Here is example:

    function pageLoad() {
          $find("SearchBox1").set_emptyMessage("Foo");
    }

    Greetings,
    Genady Sergeev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. ACubukcu
    ACubukcu avatar
    9 posts
    Member since:
    Oct 2005

    Posted 01 Feb 2013 Link to this post

    Hi Genady,

    Thanks for your reply.

    "set_emptyMessage" method, doesn't do what I am trying to achive. 
    I'd like to have something like set_text or set_value method to emulate/initiate user input.

    I see that there is an "input" control inside the search box.  That's where I want to access.

    Thanks,
    AC
  5. ACubukcu
    ACubukcu avatar
    9 posts
    Member since:
    Oct 2005

    Posted 01 Feb 2013 Link to this post

     
    Got it working:

     

    var rsBox = document.getElementById("RadSearchBox1");

     

    var rsInput = rsBox.getElementsByTagName("input");

    rsInput[0].value = "foo"

     

    AC

Back to Top