title: How to add preformatted text on text fields by clicking a button from another page
body: <p>newbie here. Using php. So I have a button. When clicked will go to a contact page that I have already done. But I need to automatically put text into a text field for the message. All one has to do is click send as it is already formatted for them. How do I make the button automatically add text into the textfield(s)? I now realize it probably needs an onlick event or anything similar on the button that will post values on some text fields on the contact page being called. I hope I have given a better description of my problem. thanks guys.</p>
  
  <p>Say this is my button:</p>
  
  <pre><code>&lt;input type="submit" name="button" id="button" value="Submit" /&gt;
  </code></pre>
  
  <p>on submit will go to contact page and fill in the values of some textfields I need preformatted.</p>
  
  <p>here's my sample mailer script.</p>
  
  <pre><code>&lt;?php 
  //print_r($_POST);
  if(isset($_POST['_save'])) {
      $name = $_POST['name'];
      $email = $_POST['email'];
      $company = $_POST['company'];
      $message = $_POST['message'];
      $subject = $_POST['subject'];
  
      if (empty($name) || empty($email) || empty($subject) || empty($message)) {
          if (empty($name))
              $error['name'] = "Please enter your Full Name";
          if (empty($email))
              $error['email'] = "Please enter a valid Email Address";
          if (empty($company))
              $error['company'] = "Please enter Your Company Name";
          if (empty($subject))
              $error['subject'] = "Please Write a Subject";
  
      }
      else { //if not empty
  
          $headers="From: {$email}\r\nReply-To: {$email}"; //create headers for email
          $content="Name: ".$name."\r\n\r\nCompany: ".$company."\r\n\r\nSubject: ".$subject."\r\n\r\nMessage: ".$message;
          mail('email@domain.com',$subject,$content,$headers); //mail the message;
          $success = "Thank you! You're email has been sent.";
          #done;
      }
  }
  ?&gt;
  </code></pre>