SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,657
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Accessing the GET global array?

    I have a contact form (sendmessage.php) with this radio button,
    HTML Code:
    <input type="radio" name="subject" id="rb_subj3" value="3"  />Register
    I want my users to click on a link like this
    HTML Code:
    <a href="sendmessage.php?Register">Register now!</a>
    Which would take them to the contact form with the radio button prefilled.
    Heres what I have soo far.
    HTML Code:
    <script language="text/javascript">
    
    if($_GET['Register'])
    this.form.rb_subj3.checked = true
    
    </script>
    Can I get some help?
    Thanks
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    SitePoint Addict jtrelfa's Avatar
    Join Date
    Oct 2004
    Location
    Troy, Mi
    Posts
    231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The $_GET var is part of PHP - not javascript?

    Why not this:
    Code:
    <input type="radio" <?= isset($_GET["Register"]) ? "checked" : "" ?>>

  3. #3
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,657
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    wow, your smart, I wasnt sure if I could use php for this
    "Oh, and Jenkins--apparently your mother died this morning."


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
  •