www.webdeveloper.com
Results 1 to 2 of 2

Thread: Contact Form Help

  1. #1
    Join Date
    Jul 2004
    Location
    MI
    Posts
    90

    Contact Form Help

    I need the easiest yet neatest way to do something, because everything else isnt going so well.

    I have a web page (contact.php) file, so in the body contents I'll have 3 names Jon Cristina & both as of now they're all hyperlinks.

    Beneath those hyperlinks I have a contact form. Is there a way that when clicked on the specific name, their apppropriate email address to go in the email text box?

    Or what else could I do?

  2. #2
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    Code:
    <a href="jon.html" onclick="document.forms[0].email.value='Jon'; return false;">Jon</a>
    The above assumes you only have one (1) form on the page, and the email input's name attribute is set to "email"; it also assumes that "jon.html" exists and is a form to contact Jon. This is for users without JavaScript; you may reload the same page with a query string and automatically fill-in the input based on the URI, if one is present.

    PHP Code:
    <input type="text" name="email" value="<?php if(isset($_GET["u"])) echo $_GET["u"]; ?>">

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles