I have gone through a bunch of question posts, and found one person with the same issue as me, but the answer he/she received I did not find to help at all.
I created a form which uses checkboxes. Once submitted my entire form is processed beautifully and I do receive the mail, but when it comes to the checkboxes it only displays "Array" in the email in stead of the checked checkbox values....
What am I doing wrong?
HTML Form Code: as requested, the full form
<form name="busquoteform" method="post" action="FormToEmail.php">
<fieldset>
<legend>Contact Information</legend>
<table width="100%">
<tr>
<td width="40%">
<label><strong>Name *:</strong></label><br/>
<input name="name" type="text" id="name" value="" />
</td>
<td width="10%"> </td>
<td width="40%">
<label><strong>Lastname *:</strong></label><br />
<input name="lname" type="text" id="lname" value="" />
</td>
</tr>
</table>
<table width="100%">
<tr>
<td width="25%">
<label><strong>Contact Number:</strong></label><br/>
<input name="contactno" type="text" id="contactno" value="" />
</td>
<td width="25%">
<label><strong>Mobile Number * </strong></label><br/>
<input name="mobno" type="text" id="mobno" value="" />
</td>
<td width="40%">
<label><strong>Email *:</strong></label><br/>
<input name="email" type="text" id="email" value="" />
</td>
</tr>
</table>
</fieldset>
<br/>
<fieldset>
<legend>Company Information</legend>
<table width="100%">
<tr>
<td width="40%">
<label><strong>Company Name *:</strong></label><br/>
<input name="compname" type="text" id="compname" value="" />
</td>
<td width="10%">
<label><strong>Position Held *:</strong></label><br />
<input name="position" type="text" id="position" value="" />
</td>
<td width="40%">
</td>
</tr>
</table>
<table width="100%">
<tr>
<td width="16%">
<label><strong>Company Address*:</strong></label><br/><br/><br/><br/>
</td>
<td width="2%">
</td>
<td>
<input name="street" type="text" id="street" value="Street" size="30" /><br/>
<input name="suburb" type="text" id="suburb" value="Suburb" size="30" /><br/>
<input name="city" type="text" id="city" value="City" size="30" /><br/>
<input name="code" type="text" id="code" value="Postal Code" size="10" /><br/>
</td>
</tr>
</table>
</fieldset>
<br/>
<fieldset>
<legend>Project Information</legend>
<table>
<tr>
<td>
<label><strong>Service Type/s*:</strong></label><br/>
Please select all applicable types.
</td>
</tr>
<tr>
<td>
Graphic Design <input name="serviceType[]" id="design" type="checkbox" value="Graphic Design" />
Web Development <input name="serviceType[]" id="webdev" type="checkbox" value="Web Development" />
Application Development <input name="serviceType[]" id="appdev" type="checkbox" value="App Development" />
Embroidery <input name="serviceType[]" id="embroidery" type="checkbox" value="Embroidery" />
Engraving <input name="serviceType[]" id="engrave" type="checkbox" value="Engraving" /><br/><br/>
</td>
</tr>
<tr>
<td>
<label><strong>Please supply a detailed description of your requirements*:</strong></label><br/>
<textarea name="projectDes" cols="60" rows="10" id="projectDes"></textarea>
<br/><br/>
<input name="quoteBus" type="submit" class="ZD-button" value="Send Request"/>
</td>
</tr>
</table>
</fieldset>
</form>
and the php processing code:
$mailBody = "Name : ".$_REQUEST['name']. " ".$_REQUEST['lname'].
" <br/>Email : ".$_REQUEST['email'].
" <br/>Contact No : ".$_REQUEST['contactno']. " Mobile No: ".$_REQUEST['mobno'].
"<br/><br/>Company Name : ".$_REQUEST['compname'].
" <br/>Postion Held : ".$_REQUEST['position'].
"<br/><br/>Company Address : <br/>".$_REQUEST['street']."<br/>".$_REQUEST['suburb']."<br/>".$_REQUEST['city']."<br/>".$_REQUEST['code'].
"<br/><br/> Service Type/s :" .(is_array($_REQUEST['serviceType'])?implode("\n", $_REQUEST['serviceType']):$_REQUEST['serviceType'])."<br />".
"<br/><br/>Details of Project : ".$_REQUEST['projectDes'];
I've also tried:
" Service Type/s :" .$serviceType = $_POST["serviceType"];$serviceType = implode(', ', $serviceType);"".
and also does not seem to work...
I got this code from a project my hubby did a while back - but he is not a php developer, he's into Java...
Help Please?
Update
I just tried your code and it works fine, and results what you want. So can you please show your <form> tag.
Code that I tested
<?php
echo (is_array($_REQUEST['serviceType']) ? implode("\n", $_REQUEST['serviceType']) : $_REQUEST['serviceType']);
?>
<form action="" method="post">
Graphic Design <input name="serviceType[]" id="design" type="checkbox" value="Graphic Design" />
Web Development <input name="serviceType[]" id="webdev" type="checkbox" value="Web Development" />
Application Development <input name="serviceType[]" id="appdev" type="checkbox" value="App Development" />
Embroidery <input name="serviceType[]" id="embroidery" type="checkbox" value="Embroidery" />
Engraving <input name="serviceType[]" id="engrave" type="checkbox" value="Engraving" /><br/><br/>
<input type="submit" />
</form>
Hm, that's strange.. It should show all the serviceType values seperated by \n, due to this line:
(is_array($_REQUEST['serviceType'])?implode("\n", $_REQUEST['serviceType']):$_REQUEST['serviceType'])
What if you change $_REQUEST to $_POST?
You can use foreach this way:
$serviceTypes = "";
if (is_array($_REQUEST['serviceType']))
{
foreach ($_REQUEST['serviceType'] as $serviceType)
{
$serviceTypes.= "$serviceType\n";
}
}
It's a possibility.
Related
I want to received 4,5 row data in php. When I put values in the form like 3 or 4 row than I want to received the same data in php :(
I am trying to make a pos. When the customer order multiple product than the order row automatically increase but there is no limit 5, 10, 15 or else.
And I want to received the data value in same rows like
<form name="data" method="post" action="data_rec.php" enctype="multipart/form-data">
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
</tr>
<tr>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
</tr>
<tr>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
</tr>
<tr>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
</tr>
<tr>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
<td>
<input name="data[]" type="text" id="data1" />
</td>
</tr>
</table>
<input name="Submit" type="submit" value="SEND">
</form>
<?php
foreach (array_combine($_POST['data'], $_POST['data']) as $i => $data) {
$i."<br />";
echo $data."<br />";
echo "SAGOR"."<br />";
}
?>
Output :
1
SAGOR
2
SAGOR
3
SAGOR
4
SAGOR
5
SAGOR
6
SAGOR
7
SAGOR
8
SAGOR
SAGOR
But I need :
1 2 3 4
SAGOR
5 6 7 8
You can add rows to your form on the browser with JS or JQuery.
You must give each row's elements unique ids/names like: <input name="data2" type="text" id="data2" /> <input name="data3" type="text" id="data3" />...
You will receive them all in you $_POST when the user submit the form
I had tried to insert bulk data with same name field contains multiple rows. But only single row is inserted.
How to insert bulk data as different values to insert into the database.
INSERT INTO table_name (username, luck_number, test, tester) VALUES (('$username', '$luck_number', '$test', '$tester').
<tr>
<td>1</td>
<input type="hidden" name="username" value="<?php echo $login_session; ?>" />
<td>
<input type="text" name="luck_number" value="" />
</td>
<td>
<input type="text" name="big" value="" />
</td>
<td>
<input type="text" name="test" value="" />
</td>
<td>
<input type="text" name="tester" value="" />
</td>
</tr>
<tr>
<td>2</td>
<input type="hidden" name="username" value="<?php echo $login_session; ?>" />
<td>
<input type="text" name="luck_number" value="" />
</td>
<td>
<input type="text" name="big" value="" />
</td>
<td>
<input type="text" name="test" value="" />
</td>
<td>
<input type="text" name="tester" value="" />
</td>
</tr>
<tr>
<td>3</td>
<input type="hidden" name="username" value="<?php echo $login_session; ?>" />
<td>
<input type="text" name="luck_number" value="" />
</td>
<td>
<input type="text" name="big" value="" />
</td>
<td>
<input type="text" name="test" value="" />
</td>
<td>
<input type="text" name="tester" value="" />
</td>
</tr>
#nisha,In your scenario only single row is inserted because variables are same name so it's overridden, Please try below code, It will give you array of fields so you can easily create for-loop & do multiple insert with your query.
<form method="post" name="userdata">
<tr>
<td>1</td>
<input type="hidden" name="username[]" value="<?php echo $login_session; ?>" />
<td>
<input type="text" name="luck_number[]" value="" />
</td>
<td>
<input type="text" name="big[]" value="" />
</td>
<td>
<input type="text" name="test[]" value="" />
</td>
<td>
<input type="text" name="tester[]" value="" />
</td>
</tr>
<tr>
<td>2</td>
<input type="hidden" name="username[]" value="<?php echo $login_session; ?>" />
<td>
<input type="text" name="luck_number[]" value="" />
</td>
<td>
<input type="text" name="big[]" value="" />
</td>
<td>
<input type="text" name="test[]" value="" />
</td>
<td>
<input type="text" name="tester[]" value="" />
</td>
</tr>
<tr>
<td>3</td>
<input type="hidden" name="username[]" value="<?php echo $login_session; ?>" />
<td>
<input type="text" name="luck_number[]" value="" />
</td>
<td>
<input type="text" name="big[]" value="" />
</td>
<td>
<input type="text" name="test[]" value="" />
</td>
<td>
<input type="text" name="tester[]" value="" />
</td>
</tr>
<input type="submit" name="submit">
</form>
**Note:**you can worry about the security issue letter. read the answer with the comment.
Store them in array by adding [ ] this in your input field
<tr>
<td>1</td>
<form action="" method="POST">
<input type="hidden" name="username" value="<?php echo $login_session; ?>"/>
<td><input type="text" name="luck_number[]" value=""/></td>
<td><input type="text" name="big[]" value=""/></td>
<td><input type="text" name="test[]" value=""/></td>
<td><input type="text" name="tester[]" value=""/></td>
</tr>
<tr>
<td>2</td>
<input type="hidden" name="username" value="<?php echo $login_session; ?>"/>
<td><input type="text" name="luck_number[]" value=""/></td>
<td><input type="text" name="big[]" value=""/></td>
<td><input type="text" name="test[]" value=""/></td>
<td><input type="text" name="tester[]" value=""/></td>
</tr>
<tr>
<td>3</td>
<input type="hidden" name="username" value="<?php echo $login_session; ?>"/>
<td><input type="text" name="luck_number[]" value=""/></td>
<td><input type="text" name="big[]" value=""/></td>
<td><input type="text" name="test[]" value=""/></td>
<td><input type="text" name="tester[]" value=""/></td>
</tr>
<tr></td><input type="submit" name="submit" value="submit"/><tr></td>
</form>
<?php
//connect with your database
for($i=0;$i<count($_POST['luck_number']);$i++)
{
//set the value for variable
$luck_number=$_POST['luck_number'][$i];
$test=$_POST['test'][$i];
$tester=$_POST['tester'][$i];
//run your query
//INSERT INTO table_name (username, luck_number, test, tester) VALUES (('$username', '$luck_number', '$test', '$tester').
}
First of all change all field names by adding [] at the end.
Second step, to parsing all values you may use something like this
for($i=0; $i < $count($_GET['username']); $i++)
{
$username = $_GET['username'][$i];
$luck_number= $_GET['luck_number'][$i];
$big= $_GET['big'][$i];
$test= $_GET['test'][$i];
$tester= $_GET['tester'][$i];
// insert into database
}
The reason of inserting single row instead of multiple rows is your input field name. You are using same name in different input field so when the server gets the reply it replace the duplicate name and the last occurrence is outputted.
The thing you have to do is to use array. If you use known number of rows then you can simply use a for loop to insert data.
<tr>
<td>1</td>
<input type="hidden" name="username[]" value="<?php echo $login_session; ?>" />
<td>
<input type="text" name="luck_number[]" value="" />
</td>
<td>
<input type="text" name="big[]" value="" />
</td>
<td>
<input type="text" name="test[]" value="" />
</td>
<td>
<input type="text" name="tester[]" value="" />
</td>
</tr>
<tr>
<td>2</td>
<input type="hidden" name="username[]" value="<?php echo $login_session; ?>" />
<td>
<input type="text" name="luck_number[]" value="" />
</td>
<td>
<input type="text" name="big[]" value="" />
</td>
<td>
<input type="text" name="test[]" value="" />
</td>
<td>
<input type="text" name="tester[]" value="" />
</td>
</tr>
<tr>
<td>3</td>
<input type="hidden" name="username[]" value="<?php echo $login_session; ?>" />
<td>
<input type="text" name="luck_number[]" value="" />
</td>
<td>
<input type="text" name="big[]" value="" />
</td>
<td>
<input type="text" name="test[]" value="" />
</td>
<td>
<input type="text" name="tester[]" value="" />
</td>
</tr>
<?php
for ($i=0; $i<count($_POST['username']); $i++)
{
mysql_query("INSERT INTO table_name (`username`, `luck_number`, `test`, `tester`) VALUES (('".$_POST['username'][$i]."', '".$_POST['luck_number'][$i]."', '".$_POST['test'][$i]."', '".$_POST['tester'][$i]."')");
}
?>
Note: Sanitizing variable is always been a good practice and strongly recommended.
It is a regitration page in php where image is also uploading along with other user data but it is always showing error please help me to figure out the problem.It is always showing fail but i am using correct image. I also want to know how to set default value for profile image in phpmyadmin and how to query to update it when user enter his choice along with other user data that is to be inserted into database with insert query. and how to do insertion and updation at same time i.e inserting user data and updating default image.
<?php
include_once 'conn.inc';
if(isset($_POST["btnsave"])) {
$filename=$_FILES['file']['name'];
$size=$_FILES['file']['name'];
$extenstion=pathinfo($filename,PATHINFO_EXTENSION);
if($extenstion=='jpeg' || $extenstion=='png' || $extenstion=='jpg' && $size<=30000) {
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
}
else {
echo "failhhhhhhhhhh";
}
$name=mysql_real_escape_string($_POST["txtname"]);
$fname=mysql_real_escape_string($_POST["txtfname"]);
$gender=mysql_real_escape_string($_POST["gender"]);
$image=$_FILES['file']['name'];
$des=mysql_real_escape_string($_POST["des"]);
$job=mysql_real_escape_string($_POST["txtjob"]);
$country=mysql_real_escape_string($_POST["txtcountry"]);
$state=mysql_real_escape_string($_POST["txtstate"]);
$city=mysql_real_escape_string($_POST["txtcity"]);
$contact=mysql_real_escape_string($_POST["txtcontact"]);
$contactst=mysql_real_escape_string($_POST["contactst"]);
$email=mysql_real_escape_string($_POST["txtemail"]);
$emailst=mysql_real_escape_string($_POST["emailst"]);
$query="insert into tblregistration values
('','$name','$fname','$gender','$image','$des','$job','$country','$state','$city','$contact','$contactst','$email','$emailst')" or die('neverve'.mysql_error());
$res=mysql_query($query) or die('error 1'.mysql_error());
if(mysql_affected_rows())
{
echo "success";
}
else {
echo "failure";
}
}
?>
html form
<form method="post" action="registration.php" enctype="multipart/form-data">
<table>
<tr>
<td><label for="txtname">Name</label></td>
<td><input type="text" name="txtname" value="Enter your name"/></td>
</tr>
<tr>
<td><label for="txtfname">Father Name</label></td>
<td><input type="text" name="txtfname" value="Enter your father's name"/></td>
</tr>
<tr>
<td><label>Gender</label></td>
<td>Male<input type="radio" name="gender" checked="checked" value="m" />
Female<input type="radio" name="gender" value="f" />
</td>
</tr>
<tr>
<td>
<input onchange="readURL(this);" type="file" name="file" /></td>
<td><img alt="Image Display Here" id="test" src="./upload/icon3.jpg" height="100px" width="100px" /></td>
</tr>
<tr>
<td><label>Designation</label></td>
<td><select name="des">
<option value="-1">Select Designation</option>
<option value="Employed">Employed</option>
<option value="selfemployed">Self-Employed</option>
<option value="retired">Retired</option>
</select></td>
</tr>
<tr>
<td>
<label>Title of Job</label></td>
<td><input type="text" name="txtjob" value="title of job" /></td>
</tr>
<tr>
<td>
<label>Country</label></td>
<td><input type="text" name="txtcountry" value="Enter your country" /></td>
</tr>
<tr>
<td>
<label>State</label></td>
<td><input type="text" name="txtstate" value="Enter your State" /></td>
</tr>
<tr>
<td>
<label>City</label></td>
<td><input type="text" name="txtcity" value="Enter your city" /></td>
</tr>
<tr>
<td>
<label>Contact no</label></td>
<td><input type="tel" name="txtcontact" value="Enter your contact no" />
Private<input type="radio" name="contactst" value="0" /> Public<input type="radio" name="contactst" checked="checked" value="1"/>
</td>
</tr>
<tr>
<td>
<label>Email</label></td>
<td><input type="email" name="txtemail" value="Enter your email" />
Private<input type="radio" name="emailst" value="0" /> Public<input type="radio" name="emailst" checked="checked" value="1" />
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="btnsave" value="submit" /></td>
</tr>
</table>
</form>
$size=$_FILES['file']['name']; please check this condition
Replace
$size=$_FILES['file']['name'];
with
$size=$_FILES['file']['size'];
well, now, i created a form, and this is it:
<html>
<body bgcolor="lightblue">
<form align="center" action="connect2.php" method="post" style="bgcolor:red">
<div style="margin-left:433px" >
Registration No.: <input type="text" name="reg" /><br />
</div>
</br>
Name: <input type="text" name="name" size="50" style="margin-left:7px" />
<span style="margin-left:6px">
Date of Birth: <input type="text" name="birth" size="30" /></br>
</span>
<div style="margin-left:12px">
Age: <input type="text" name="age" size="15" style="margin-left:7px" />
<span style="margin-left:167px">
Class at August 2012 <input type="text" name="class" size="30" />
</span>
</div>
School: <input type="text" name="school" size="102" style="margin-left:5px" />
</br></br>
Father's Name: <input type="text" name="father" size="94" style="margin-left:5px" /> </br>
Father's Occupation: <input type="text" name="focc" size="89" />
</br></br>
Mother's Name:<input type="text" name="mother" size="94" style="margin-left:3px" /> </br>
Mother's Occupation: <input type="text" name="mocc" size="88" />
</br></br>
<center>
<table bgcolor="pink" width="95" height="100"style="margin-left:0px; margin-top:5px" border="0">
<tr>
<td colspan="3">
Siblings, if any:
</td>
</tr>
<tr align="center"style="font-weight:bold">
<td width="5"></td>
<td width="20">Name</td>
<td width="50">Age</td>
<td width="20">School</td>
</tr>
<tr align="right">
<td>1.</td>
<td align="center"><input type="text" name="ssname" size="44" /></td>
<td align="center"><input type="text" name="sage1" size="5" /></td>
<td align="center"><input type="text" name="sschool1" size="44" /></td>
</tr>
<tr align="right">
<td>2.</td>
<td align="center"><input type="text" name="sname2" size="44" /></td>
<td align="center"><input type="text" name="sage2" size="5" /></td>
<td align="center"><input type="text" name="sschool2" size="44" /></td>
</tr>
<tr align="right">
<td >3.</td>
<td align="center"><input type="text" name="sname3" size="44" /></td>
<td align="center"><input type="text" name="sage3" size="5" /></td>
<td align="center"><input type="text" name="sschool3" size="44" /></td>
</tr>
</table>
</center>
</br>
Address: <input type="text" name="address" size="101" /> </br>
<p align="left" style="margin-left:271px">
Phone Number: <input type="text" name="phone" size="20" /> </br>
Cell Number (Mother/Father): <input type="text" name="cp" size="20" /></br>
Email (Mother/Father): <input type="text" name="email" size="28"/>
</p>
<input type="Submit" name="submit" value="submit" />
</form>
</body>
</html>
and then this is my php code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<body>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("sy_database", $con);
$sq$sql="INSERT INTO sy_form (reg_no, name, birth, age, sclass, school, fname, focc, mname, mocc, address, phone, cp, email)
VALUES('$_POST[reg]','$_POST[name]','$_POST[birth]','$_POST[age]','$_POST[class]','$_POST[school]','$_POST[fname]','$_POST[focc]','$_POST[mname]','$_POST[mocc]','$_POST[address]','$_POST[phone]','$_POST[cp]','$_POST[email]'),
INSERT INTO siblings(sname,sage,sschool) values('$_POST[ssname]','$_POST[sage1]','$_POST[sschool1]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con);
?>
</body>
</html>
i need to insert data into two tables from that single form.
the 1st table are for the person who wants to register and the second is for the siblings of that person.
and how come that the AGE won't appear? and the class at january does not appear also.
cellphone number would always be 2147483647?
gawd, I'm so ruined!
could anyone please help me with this? i really want to learn. :(
Ahh, you can't merge queries like that. Try following
$sql1="INSERT INTO sy_form (reg_no, name, birth, age, sclass, school, fname, focc, mname, mocc, address, phone, cp, email)".
"VALUES('$_POST[reg]','$_POST[name]','$_POST[birth]','$_POST[age]','$_POST[class]','$_POST[school]','$_POST[fname]','$_POST[focc]','$_POST[mname]','$_POST[mocc]','$_POST[address]','$_POST[phone]','$_POST[cp]','$_POST[email]')";
$sql2="INSERT INTO siblings(sname,sage,sschool)values('$_POST[ssname]','$_POST[sage1]','$_POST[sschool1]')";
if (!mysql_query($sql1,$con))
{
die('Error: ' . mysql_error());
}
if (!mysql_query($sql2,$con))
{
die('Error: ' . mysql_error());
}
Well that is just starting, to make your program run. There are lot to learn.
My date picker and time picker don't show up next to the "Enter date:" and "Enter time:" fields: http://heightsdental.com/RequestAppt.php. There are php include statements in the code, and when they're not there: http://evamagnus.com/RequestAppt.php, the date and time pickers are displayed.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/modernizr-2.5.3.min.js"></script>
<script type="text/javascript" src="js/jquery.ptTimeSelect.js"></script>
<script src="js/dimensions.js" type="text/javascript"></script>
<script src="js/jquery.ui.core.js">
</script>
<script src="js/jquery.ui.datepicker.js">
</script>
<?php
include "Banner.html";
include "header.html"
?>
<div id="form">
<div id="contain">
<form action="http://www1.budgethostingweb.com/cgi-bin/hosting/user_formmail.cgi" method="post">
<input type="hidden" name="account" value="dentist">
<input type="hidden" name="cata" value="accounts">
<input type="hidden" name="redirect" value="index.php" />
<table class="form_demo">
<tr>
<td>
<label for="name">
Name
</label>
</td>
<td>
<input class="input_full" type="text" id="name" name="name" required="required" />
</td>
</tr>
<tr>
<td><label for="email">
Email
</label>
</td>
<td>
<input class="input_full" type="email" id="email" name="email" required="required" />
</td>
</tr>
<tr>
<td>
<label for="cc">
<abbr title="Courtesy Copy">CC</abbr>
</label>
</td>
<td>
<input type="checkbox" id="cc" name="cc" value="1" />
<label for="cc">
Send me a copy of this email
</label>
</td>
</tr>
<tr>
<td>
<label for="tel">
Phone
</label>
</td>
<td>
<input class="input_full" type="tel" id="tel" name="tel" required="required" />
</td>
</tr>
<tr>
<td><label for="priority_normal">
Priority
</label>
</td>
<td>
<input type="radio" name="priority" id="priority_urgent" value="Urgent">
<label for="priority_urgent">
Urgent
</label>
<input type="radio" name="priority" id="priority_normal" value="Normal" checked="checked">
<label for="priority_normal">
Normal
</label>
</td>
</tr>
<tr>
<td>
<label for="date">Enter a date:</label>
</td>
<td>
<input class="input_xlarge" type="text" id="date" name="date" required="required" />
<script>
(function($){
var pickerOpts = {
minDate: new Date(),
maxDate: "+3m,",
showButtonPanel: true,
showOn: "button",
buttonImage: "images/cal.png",
};
$("#date").datepicker(pickerOpts);
})(jQuery);
</script>
</td></tr>
<tr><td>Enter a time: </td>
<td><input id="time1" name="s2Time1" />
<script type="text/javascript">
$('#time1').ptTimeSelect({ popupImage: 'Select Time' });
</script>
</td>
</tr>
<tr>
<td>
<label for="description">
Reason for<br />
appointment
</label>
</td>
<td>
<textarea id="description" name="description" rows="3" required="required"></textarea>
</td>
</tr>
<tr><td colspan="2">To prevent automated spam posts, <br>please type in the access code
displayed: <p><img alt="Access code"
src="http://www1.budgethostingweb.com/cgi-bin/captcha/imagegen.cgi?x-factor=1"/></p></td></tr>
<tr><td>Access Code:</td> <td><input class="medium" name="access" type="text"></td>
</tr>
</table>
<hr />
<p class="clearfix">
<input type="submit" value="Submit" class="float_left" />
<input type="reset" value="Reset" class="float_right">
</p>
</form>
File missing at below path:
http://heightsdental.com/js/jquery.ui.core.js
http://heightsdental.com/js/jquery.ui.datepicker.js
Your jQuery UI script include is failing.
A quick look into chrome's dev tools reveals:
Failed to load resource: the server responded with a status of 404 (Not Found) http://heightsdental.com/js/jquery.ui.core.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://heightsdental.com/js/jquery.ui.datepicker.js
Uncaught TypeError: Object [object Object] has no method 'datepicker' RequestAppt.php:159
Uncaught TypeError: Property '$' of object [object Window] is not a function RequestAppt.php:167
Meaning: Your JavaScript includes point to files that do not exist.
Looking into your js subdir shows: They really are not there.
(It's bad btw. to allow indexing, disable directory listing)