SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question value of querystring into an <input> text field

    Hi All,
    I'm new here and very new to JavaScript. I do however have a problem that needs solving and hope someone can help. I've been using FrontPage to design my website, but it's starting to fail me now.

    I'd like to use JavaScript to write the value of the querystring into an <input> text field, when the page is loaded.

    Can anyone help please??
    Thanks

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2004
    Posts
    1,647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    window.onload = function() {
    document.getElementById("your_text_input_id").value = "your new value";
    }
    cheers

  3. #3
    SitePoint Addict jtrelfa's Avatar
    Join Date
    Oct 2004
    Location
    Troy, Mi
    Posts
    231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try:
    Code:
    document.getElementById('inputfield').value = document.location.search;
    Keep in mind that will include the '?' as well, so you may want to parse that out.


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
  •