473,320 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Trying to get a select button to output into a form email..

hi,

i've got a form in which the user can fill out consisting of 2 text boxes to enter information in, a drop down box of choices and of course a submit button. when they fill it out, it sends the email of information to me fine. everything comes through apart from the option they've chosen from the drop down box.

the code i have is the following;

Expand|Select|Wrap|Line Numbers
  1. <form action="mail.php" method="post">
  2. <input onfocus="this.select()" name="name" id="name" type="text" tabindex="1" value="name">
  3. <input onfocus="this.select()" name="phone" id="phone" type="text" tabindex="2" value="phone number" > 
  4.  <br />
  5.  <select name="time" id="time" value="time" size="1" tabindex="3">
  6.     <option value="9">09:00</option>
  7.     <option value="930">09:30</option>
  8.     <option value="9">10:00</option>
  9.     <option value="930">10:30</option>
  10.     <option value="9">11:00</option>
  11.     <option value="930">11:30</option>
  12.     <option value="9">12:00</option>
  13.     <option value="930">12:30</option>
  14.     <option value="9">13:00</option>
  15.     <option value="930">13:30</option>
  16.     <option value="9">14:00</option>
  17.     <option value="930">14:30</option>
  18.     <option value="9">15:00</option>
  19.     <option value="930">15:30</option>
  20.     <option value="9">16:00</option>
  21.     <option value="930">16:30</option>
  22.     <option value="930">17:00</option>
  23.   </select>
  24.  <input name="submit" id="submit" type="submit" value="call me" tabindex="4">
  25. </form>
and the php is

Expand|Select|Wrap|Line Numbers
  1. <?
  2. header("Location: thankyou.php"); 
  3. function checkOK($field)
  4. {
  5. if (eregi("\r",$field) || eregi("\n",$field)){
  6. die("Invalid Input!");
  7. }
  8. }
  9.  
  10.  
  11. $name=$_POST['name'];
  12. checkOK($name);
  13. $phone=$_POST['phone'];
  14. checkOK($phone);
  15. $time=$_POST['time'];
  16. checkOK($time);
  17.  
  18. mail("my email address is here", 'Online Form: ', "\n\n Name -"."$name" ."\n\n Phone - "."$phone" "\n\n Time -"."$time");
  19.  
  20. ?>

Its obviously having troubles picking setting the variable for the drop down box, anyone know what im doing wrong?

Thanks
Jul 31 '08 #1
3 1739
acoder
16,027 Expert Mod 8TB
Remove the value attribute for the select element. You also have only two values for the options unless that's intentional.
Jul 31 '08 #2
Thank you very much again!
Jul 31 '08 #3
acoder
16,027 Expert Mod 8TB
No problem. Glad it's working.
Jul 31 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: cooldv | last post by:
i have an *access database + ASP newsletter* that is working fine and it sends newsletter to ALL the email addresses in the DB. i want to send this newsletter to only a select group (like people...
2
by: Mark | last post by:
Hi - I have a dynamically created table, which has a number of forms - each named consecutively as 'adduserX' where X is a number generated from ASP. Within each form, I need to have a button...
7
by: RC | last post by:
When I am adding records to a database and each record is unique by the Serial Number. I would like to step through my code adding records unless the Serial Number already exists in the database. ...
6
by: Chris Fink | last post by:
Does anyone know it is possible to include a small image(.gif .jpeg) within a <SELECT><option> so that the user would see the option text as well as a little image(icon) in the option? I know this...
14
by: GabrielESandoval | last post by:
I need to make a registration page for a community service volleyball tournament our organization is doing. I am VERY NEW to ASP. Would the easiest way to make it be just doing it on frontpage...
1
by: inventor | last post by:
I'm doing programming for my science prodject, and when I was programming (I'm building an alphebatizer) I ran into this bug: I've got an input box, but no button or output box. so I do some...
1
by: Chris Lieb | last post by:
In a form, I have two select lists. One holds the available options. I have some buttons between them for moving items from one list to the other. When the form first loads, all of the items are...
0
by: Luke Herbert | last post by:
I am very new to C# and have been trying to get to grips with it by writing a small tool to detect a USB key being inserted and then backup user specified files to the key. I have written some...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.