Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Adding Text Into Textbox with JavaScript

  1. #11
    Join Date
    Nov 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default check this other scripts

    Check this scripts. Its a very easy to use http://www.dynamicdrive.com/forums/s...ad.php?t=39234

  2. #12
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,375
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by osirix View Post
    Sorry if i sound stupid but is it possible to pass a JS variable into the
    text value

    e.g. var new ="somethign";
    <a href="javascript:insertText(' var new ' ,'user_location');" onClick="void(0)">Insert 'Hello'</a>

    so when you click it

    somethign will be displayed in the box instead of the var new text being displayed

    i want to out put the contents of the variable not the name of it
    thanks in advance
    Code:
    <script type="text/javascript">
    var newtext = "something";
    </script>
    HTML Code:
    <a href="#" onclick="insertText(newtext ,'user_location'); return false;">Insert Something</a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •