Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Querystring to input field

    I'm using this script to get the HID variable from the querystring

    <script type="text/javascript">
    hid = window.location.search.substring(1);
    document.write(hid);
    </script>

    instead of using document.write how do i modify this script to populate the value of HID into an input field?

    thanks
    Hector

  • #2
    Regular Coder
    Join Date
    Nov 2007
    Location
    127.0.0.1
    Posts
    348
    Thanks
    26
    Thanked 40 Times in 39 Posts
    How about this?
    Code:
    <input type="text" name="test" id="test"/>
    <script type="text/javascript">
    hid = window.location.search.substring(1);
    document.getElementById('test').value=hid;
    </script>
    Blog Charity:Water
    WhatisWrongWith.me/tagnu - Send me anonymous feedback.


  •  

    Posting Permissions

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