Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding Images in Form Fieldsets

Posted on 2008-10-09
5
Medium Priority
?
235 Views
Last Modified: 2010-04-21
Currently I have a order form to streamline some internal orders.

It works correctly but I want to add thumbnails of the products above the checkbox.
As of right now when I try and insert any sort of picture it messed the form up or does not show up!

Can images be placed inside fieldsets?
How can I add thumbnails of my products?
<?php
if( !empty($_POST['Name']) && !empty($_POST['Email']) && !empty($_POST['Site']) )
{
	header("Content-type: text/plain"); 
	//if you set this to false you will get "No Worries Posters". 
	//When true, you just get "Posters"
	$RemoveNoWorriesPrefix=true; 
	//list or regional managers to be cc
	$RegionalManager=array();
	$RegionalManager['A']="PersonA@company.com";
	$RegionalManager['B']="PersonB@company.com";
	$RegionalManager['C']="PersonC@company.com";
	$RegionalManager['D']="PersonD@company.com";
	$RegionalManager['E']="PersonE@company.com";
	$RegionalManager['F']="PersonF@company.com"; 
	
      $submittedData="";
	 
      $submittedData.="\nName:" . $_POST['Name'];
      $submittedData.="\nEmail:" . $_POST['Email'];
      $submittedData.="\nSite:" . $_POST['Site'];
      $submittedData.="\nRegional Manager:" . $_POST['regional_manager'];
	 
	 $fields=array('Standard_Supplies','No_Worries_Flyers','No_Worries_Posters','No_Worries_Banners','No_Worries_Postcards');
	foreach($fields as $arrName)
	{
		 if(isset($_POST[$arrName]))
		 {
		 	if($RemoveNoWorriesPrefix)
				$submittedData.="\n\n" . str_replace("No Worries ","",str_replace("_"," ",$arrName));
			else
				$submittedData.="\n\n" . str_replace("_"," ",$arrName); 
		      foreach($_POST[$arrName] as $value)
		      {
		            $k=$value."_quantity";
		            if(!empty($_POST[$k]))
		                  $submittedData .= "\n\t".str_replace("_"," ",$value) . ": " . $_POST[$k];
		      }
		 }
	}
	 $headers="";
	 if(!empty($_POST['regional_manager']))
	 	$headers="CC:". $RegionalManager[ $_POST['regional_manager'] ];
      if(!empty($submittedData))
      {
            //mail("natalie.teinert@company.com","Order details",$submittedData,$headers);
		 echo $submittedData;
            echo "\n\nThank you!";
      }
      exit;
}
?>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 
<html>
<head>
<title></title>
<style type="text/css">
.row1{float:left;width:24%;}
.row2{float:left;width:20%;}
fieldset{padding:5px;}
fieldset div select{display:block;}
legend{font-weight:bold;background-color:white;}
fieldset fieldset{border:0px; border-top:1px dashed black;margin-top:1em;}
</style>
 
</head>
<body>
<form id="form1" name="form1" method="post" action="<?=$_SERVER['PHP_SELF']?>">
  <label><strong>* Name:</strong></label>
  <input name="Name" type="text" id="Name" size="27">
  <br><br>
  <label><strong>* Email:</strong></label>
  <input name="Email" type="text" id="Email" size="27">
  <br><br>
<label><strong>* Site:</strong></label>
<input name="Site" type="text" id="Site" size="29">
<br>
<br>
<label>Regional Manager
<select name="regional_manager" id="regional_manager">
  <option  value="">-</option>
  <option value="A">Person A</option>
  <option value="B">Person B</option>
  <option value="C">Person C</option>
  <option value="D">Person D</option>
  <option value="E">Person E</option>
  <option value="F">Person F</option>
</select>
</label>
<br>
<br>
  <fieldset><legend>Standard Supplies</legend> 
            <div class="row1"><input type="checkbox" name="Standard_Supplies[]" value="RateSheet" />Ratesheet <select name="RateSheet_quantity"><option value="0"  >-</option>
		  <option value="500">500</option>
		  <option value="1000">1000</option>
		  <option value="1500">1500</option>
		  <option value="2000">2000</option>
            <option value="2500">2500</option>
            <option value="3000">3000</option>
            <option value="3500">3500</option>
            <option value="4000">4000</option>
            <option value="4500">4500</option>
            <option value="5000">5000</option>
            </select></div>
            <div class="row1"><input type="checkbox" name="Standard_Supplies[]" value="Table_Drape" />Table Drape <select name="Table_Drape_quantity"><option value="0"  >-</option>
                <option value="1 - 6 ft.">1 - 6 ft.</option>
                <option value="2 - 6 ft.">2 - 6 ft.</option>
                <option value="3 - 6 ft.">3 - 6 ft.</option>
                <option value="1 - 8 ft.">1 - 8 ft.</option>
                <option value="2 - 8 ft.">2 - 8 ft.</option>
                <option value="3 - 8 ft.">3 - 8 ft.</option>
            </select></div> 
            <div class="row1"><input type="checkbox" name="Standard_Supplies[]" value="Banner_Stands" />Banner Stands <select name="Banner_Stands_quantity"><option value="0" >-</option>
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
            </select></div>
  <div class="row1"><input type="checkbox" name="Standard_Supplies[]" value="T_Shirts" />T-Shirts <select name="T_Shirts_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
      <option value="2500">2500</option>
      <option value="3000">3000</option>
      <option value="3500">3500</option>
      <option value="4000">4000</option>
      <option value="4500">4500</option>
      <option value="5000">5000</option>
  </select></div>
  </fieldset>
<br>
   <fieldset><legend>No Worries - Flyers</legend>
            <div class="row1"><input type="checkbox" name="No_Worries_Flyers[]" value="ClassFlyer" />Class In Ten Minutes? <select name="ClassFlyer_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
                <option value="2500">2500</option>
                <option value="3000">3000</option>
                <option value="3500">3500</option>
                <option value="4000">4000</option>
                <option value="4500">4500</option>
                <option value="5000">5000</option>
            </select></div>
            <div class="row1"><input type="checkbox" name="No_Worries_Flyers[]" value="ApartmentFlyer" />Apartment Hunting? <select name="ApartmentFlyer_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
                <option value="2500">2500</option>
                <option value="3000">3000</option>
                <option value="3500">3500</option>
                <option value="4000">4000</option>
                <option value="4500">4500</option>
                <option value="5000">5000</option>
            </select></div>
            <div class="row1"><input type="checkbox" name="No_Worries_Flyers[]" value="RoommateFlyer" />Roommate Hasn't Paid Up? <select name="RoommateFlyer_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
                <option value="2500">2500</option>
                <option value="3000">3000</option>
                <option value="3500">3500</option>
                <option value="4000">4000</option>
                <option value="4500">4500</option>
                <option value="5000">5000</option>
            </select></div>
  <div class="row1"><input type="checkbox" name="No_Worries_Flyers[]" value="RentsFlyer" />'Rents Cramping Your Style? <select name="RentsFlyer_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
      <option value="2500">2500</option>
      <option value="3000">3000</option>
      <option value="3500">3500</option>
      <option value="4000">4000</option>
      <option value="4500">4500</option>
      <option value="5000">5000</option>
  </select></div>
  </fieldset>
<br>
   <fieldset><legend>No Worries - Posters</legend>
            <div class="row1"><input type="checkbox" name="No_Worries_Posters[]" value="ClassPoster" />Class In Ten Minutes? <select name="ClassPoster_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
                <option value="2500">2500</option>
                <option value="3000">3000</option>
                <option value="3500">3500</option>
                <option value="4000">4000</option>
                <option value="4500">4500</option>
                <option value="5000">5000</option>
            </select></div>
            <div class="row1"><input type="checkbox" name="No_Worries_Posters[]" value="ApartmentPoster" />Apartment Hunting? <select name="ApartmentPoster_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
                <option value="2500">2500</option>
                <option value="3000">3000</option>
                <option value="3500">3500</option>
                <option value="4000">4000</option>
                <option value="4500">4500</option>
                <option value="5000">5000</option>
            </select></div>
            <div class="row1"><input type="checkbox" name="No_Worries_Posters[]" value="RoommatePoster" />Roommate Hasn't Paid Up? <select name="RoommatePoster_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
                <option value="2500">2500</option>
                <option value="3000">3000</option>
                <option value="3500">3500</option>
                <option value="4000">4000</option>
                <option value="4500">4500</option>
                <option value="5000">5000</option>
            </select></div>
  <div class="row1"><input type="checkbox" name="No_Worries_Posters[]" value="RentsPoster" />'Rents Cramping Your Style? <select name="RentsPoster_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
      <option value="2500">2500</option>
      <option value="3000">3000</option>
      <option value="3500">3500</option>
      <option value="4000">4000</option>
      <option value="4500">4500</option>
      <option value="5000">5000</option>
  </select></div>
  </fieldset>
<br>
   <fieldset><legend>No Worries - Banners</legend>
            <div class="row1"><input type="checkbox" name="No_Worries_Banners[]" value="ClassBanner" />Class In Ten Minutes? <select name="ClassBanner_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
                <option value="2500">2500</option>
                <option value="3000">3000</option>
                <option value="3500">3500</option>
                <option value="4000">4000</option>
                <option value="4500">4500</option>
                <option value="5000">5000</option>
            </select></div>
            <div class="row1"><input type="checkbox" name="No_Worries_Banners[]" value="ApartmentBanner" />Apartment Hunting? <select name="ApartmentBanner_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
                <option value="2500">2500</option>
                <option value="3000">3000</option>
                <option value="3500">3500</option>
                <option value="4000">4000</option>
                <option value="4500">4500</option>
                <option value="5000">5000</option>
            </select></div>
            <div class="row1"><input type="checkbox" name="No_Worries_Banners[]" value="RoommateBanner" />Roommate Hasn't Paid Up? <select name="RoommateBanner_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
                <option value="2500">2500</option>
                <option value="3000">3000</option>
                <option value="3500">3500</option>
                <option value="4000">4000</option>
                <option value="4500">4500</option>
                <option value="5000">5000</option>
            </select></div>
  <div class="row1"><input type="checkbox" name="No_Worries_Banners[]" value="RentsBanner" />'Rents Cramping Your Style? <select name="RentsBanner_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
      <option value="2500">2500</option>
      <option value="3000">3000</option>
      <option value="3500">3500</option>
      <option value="4000">4000</option>
      <option value="4500">4500</option>
      <option value="5000">5000</option>
  </select></div>
  </fieldset>
<br>
   <fieldset><legend>No Worries - Postcards</legend>
            <div class="row2"><input type="checkbox" name="No_Worries_Postcards[]" value="ClassPostcard" />Class In Ten Minutes? <select name="ClassPostcard_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
                <option value="2500">2500</option>
                <option value="3000">3000</option>
                <option value="3500">3500</option>
                <option value="4000">4000</option>
                <option value="4500">4500</option>
                <option value="5000">5000</option>
            </select></div>
            <div class="row2"><input type="checkbox" name="No_Worries_Postcards[]" value="ApartmentPostcard" />Apartment Hunting? <select name="ApartmentPostcard_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
                <option value="2500">2500</option>
                <option value="3000">3000</option>
                <option value="3500">3500</option>
                <option value="4000">4000</option>
                <option value="4500">4500</option>
                <option value="5000">5000</option>
            </select></div>
            <div class="row2"><input type="checkbox" name="No_Worries_Postcards[]" value="RoommatePostcard" />Roommate Hasn't Paid Up? <select name="RoommatePostcard_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
                <option value="2500">2500</option>
                <option value="3000">3000</option>
                <option value="3500">3500</option>
                <option value="4000">4000</option>
                <option value="4500">4500</option>
                <option value="5000">5000</option>
            </select></div>
  <div class="row2"><input type="checkbox" name="No_Worries_Postcards[]" value="RentsPostcard" />'Rents Cramping Your Style? <select name="RentsBanner_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
      <option value="2500">2500</option>
      <option value="3000">3000</option>
      <option value="3500">3500</option>
      <option value="4000">4000</option>
      <option value="4500">4500</option>
      <option value="5000">5000</option>
  </select></div>
  <div class="row2"><input type="checkbox" name="No_Worries_Postcards[]" value="ForeignPostcard" />Foreign City?<select name="ForeignPostcard_quantity"><option value="0" >-</option><option value="500">500</option><option value="1000">1000</option><option value="1500">1500</option><option value="2000">2000</option>
      <option value="2500">2500</option>
      <option value="3000">3000</option>
      <option value="3500">3500</option>
      <option value="4000">4000</option>
      <option value="4500">4500</option>
      <option value="5000">5000</option>
  </select></div>
  </fieldset>
<br>
<br>
<input type="submit" name="Submit" id="Submit" value="Submit"> 
</form>
</body>
</html>

Open in new window

0
Comment
Question by:natsully
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:hielo
ID: 22682427
>>Can images be placed inside fieldsets?
Yes

>>How can I add thumbnails of my products?

<div><input ...><br/>
<img src="yourimage.gif" widh="50" height="50"/><br/>
<select>...</select></div>

Open in new window

0
 
LVL 82

Accepted Solution

by:
hielo earned 2000 total points
ID: 22682440
as an example, here's the first item:
            <div class="row1">
		  	<input type="checkbox" name="Standard_Supplies[]" value="RateSheet" />Ratesheet<br/>
			<img src="http://images.experts-exchange.com/xp/images/expertTools.png" alt="" width="50" height="50"><br/> 
		  	<select name="RateSheet_quantity"><option value="0"  >-</option>
		  		<option value="500">500</option>
		  		<option value="1000">1000</option>
		  		<option value="1500">1500</option>
		  		<option value="2000">2000</option>
            		<option value="2500">2500</option>
            		<option value="3000">3000</option>
            		<option value="3500">3500</option>
            		<option value="4000">4000</option>
            		<option value="4500">4500</option>
            		<option value="5000">5000</option>
            	</select>
		  </div>

Open in new window

0
 

Author Comment

by:natsully
ID: 22682574
that's the code I was using, I guess I just didn't have it in the right spot?
Thanks again!
0
 

Author Closing Comment

by:natsully
ID: 31504832
Thanks again!
0
 
LVL 82

Expert Comment

by:hielo
ID: 22684321
you are welcome
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question