Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7584029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:49:26+00:00 2026-05-30T18:49:26+00:00

Here is the form I am using: <form action=scripts/contactscript.php method=post id=contactform> <ol> <li> <label

  • 0

Here is the form I am using:

<form action="scripts/contactscript.php" method="post" id="contactform">
  <ol>
    <li>
      <label for="name">Your Name <span class="red">*</span></label>
      <input id="name" name="name" class="text" />
    </li>
    <li>
      <label for="email">Your email <span class="red">*</span></label>
      <input id="email" name="email" class="text" />
    </li>
    <li>
      <label for="interested">Interested In <span class="red">*</span></label>
      <select id="interested" name="interested">
        <option value="">-- Please Select --</option>
        <option value="GeneralInformation">General Information</option>
        <option value="PurchasingABike">Purchasing A Bike</option>
      </select>
    </li>
    <li>
      <label for="message">Message <span class="red">*</span></label>
      <textarea id="message" name="message" rows="6" cols="50"></textarea>
    </li>
    <li class="buttons">
      <input type="image" name="imageField" id="imageField" src="images/send.gif" class="send" />
      <div class="clr"></div>
    </li>
  </ol>
</form>

And here is the script it is posting to:

<?php
if(!$_POST) exit;
$email = $_POST['email'];

//$error[] = preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS';
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email )){
    $error.="Invalid email address entered";
    $errors=1;
}

if($errors==1) echo $error;
else{
    $values = array ('name','email','message','interested');
    $required = array('name','email','message');

    $your_email = "jon.harding@webedgemedia.com";
    $email_subject = "Little Bike Riders Message: ".$_POST['subject'];
    $email_content = "New message:\n\n";

    foreach($values as $key => $value){
      if(in_array($value,$required)){
          if( empty($_POST[$value]) ) { echo 'PLEASE FILL IN REQUIRED FIELDS'; exit; }
      }
        $email_content .= $value.': '.$_POST[$value]."\n\n" ;
    }


    if(@mail($your_email,$email_subject,$email_content)) {
        echo 'Message sent!'; 
    } else {
        echo 'ERROR!';
    }
}
?>

Here is what is shown in the email when it is sent:

New message:

name: Jon Harding

email: jon@email.com

message: Test

interested:

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T18:49:27+00:00Added an answer on May 30, 2026 at 6:49 pm

    You have choosen the default entry -- Please Select -- when submitting your form which has the option value "" and that is being displayed in your email. I have tried your example locally and if I select one of the other options it is working.

    Edit:

    You are using the following code to submit your form:

    jQuery(document).ready(function(){
        $('#contactform').submit(function(){                  
            var action = $(this).attr('action');
            $.post(action, { 
                name: $('#name').val(),
                email: $('#email').val(),
                subject: $('#subject').val(),
                message: $('#message').val()
            },
                function(data){
                    $('#contactform #submit').attr('disabled','');
                    $('.response').remove();
                    $('#contactform').before('<p class="response">'+data+'</p>');
                    $('.response').slideDown();
                    if(data=='Message sent!') $('#contactform').slideUp();
                }
            ); 
            return false;
        });
    });
    

    You forgot to add the value of the interested element interested: $('#interested').val() to the object which you are passing to the $.post method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my form: <form action=/scripts/addemail_fb.php method=post> <input type=text name=email value=Enter your email here! />
Here is a simple form I am using to send XML data in admin_xml.php
To give more information I am using the modular form here: http://jqueryui.com/demos/dialog/#modal-form `b(e.target).zIndex` is
I'm using jquery to submit my form (with id #myForm here) as follows: $(document).ready(function()
Here is the input form code <tr valign=top> <td align=right class=innertablestyle><font class=normal><strong>Homepage</strong></font></td> <td>&nbsp;</td> <td>
Here is a code form a PHP+MySQL book I am reading and I am
I'm doing form validation using a PHP script. I initially wrote this code in
I am using jQuery Form Plugin http://jquery.malsup.com/form/ to submit my form. Here is the
The current form is here . It is not complete, and only a couple
Here's my code: if Request.Form(authorize) <> and request.form(delete) <> true then post_ids = Request.form(authorize)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.