EntropySink

Technical & Scientific => Programming => Topic started by: Steve on October 06, 2007, 12:28:04 PM

Title: form positioning issue
Post by: Steve on October 06, 2007, 12:28:04 PM
forms are fairly new to me because i havent used them in years, and when i did i either made them in FP (i know....) or i was just modifying existing forms. Right now the below code works great, but it shows the form like this (using the name field as ex):

First and
      Last   Form Field
     Name

I'm going for something like

First and Last Name:  Form Field


I cant seem to find where i screwed up. i know it must be obvious, and that im a e-tard, but i cant find it.


<!--Place form through div-->
<div style="position: absolute; top: 275px; left: 165px; height: 500px; width: 523px; padding: 1em; background-color: black; overflow:scroll;">
<!--End form pos-->

<!--Start form-->
<form name="frmFormMail" action="<?php print PHP_SELF ?>" method='post' enctype='multipart/form-data'>
<input type='hidden' name='formmail_submit' value='Y'>
<input type='hidden' name='esh_formmail_subject' value="Website Order">
<input type='hidden' name='esh_formmail_return_subject' value="">
<input type='hidden' name='esh_formmail_return_msg' value="">

<table cellspacing='8' cellpadding='0' border='0'  >
<tr>
<td class="form_field" valign='top' align='right'>First and Last Name </td><td width='10' aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td>
<td class="form_text">
<input type="text" name="First_and_Last_Name"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "First_and_Last_Name" ] ); ?>" class='text_box'>
</td>
</tr>


<tr>
<td class="form_field" valign='top' align='right'>Street Address </td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td>
<td class="form_text">
<input type="text" name="Street_Address"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "Street_Address" ] ); ?>" class='text_box'>
</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>City and State </td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td>
<td class="form_text">
<input type="text" name="City_and_State"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "City_and_State" ] ); ?>" class='text_box'>
</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Zip Code </td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td>
<td class="form_text">
<input type="text" name="Zip_Code"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "Zip_Code" ] ); ?>" class='text_box'>
</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Email </td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td>
<td class="form_text">
<input type="text" name="Email"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "Email" ] ); ?>" class='text_box'>
</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Event Date </td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td>
<td class="form_text">
<?php
selectList( "Event_Date_MM", $HTTP_POST_VARS["Event_Date_MM"], 1, 12, "MM", $style ) ;
selectList( "Event_Date_DD", $HTTP_POST_VARS["Event_Date_DD"], 1, 31, "DD", $style ) ;
selectList( "Event_Date_YYYY", $HTTP_POST_VARS["Event_Date_YYYY"], date("Y"), date("Y")+3, "YYYY", $style ) ;
?>

</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Athlete Name</td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td>
<td class="form_text">
<input type="text" name="Athlete_s_Name"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "Athlete_s_Name" ] ); ?>" class='text_box'>
</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Athlete Jersey #</td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td>
<td class="form_text">
<input type="text" name="Athlete_s_jerz"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "Athlete_s_jerz" ] ); ?>" class='text_box'>
</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Athlete Age </td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td>
<td class="form_text">
<input type="text" name="Athlete_s_Age"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "Athlete_s_Age" ] ); ?>" class='text_box'>
</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Sport Name </td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td>
<td class="form_text">
<input type="text" name="Sport_Name"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "Sport_Name" ] ); ?>" class='text_box'>
</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Game Loc and Time</td><td width='10'  aligh='right' valign='top'> <font size='2' color='#ff0000'>*</font> </td>
<td class="form_text">
<input type="text" name="Event_Location"  value="<?php  print HtmlSpecialChars( $HTTP_POST_VARS[ "Event_Location" ] ); ?>" class='text_box'>
</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Design Packages </td><td width='10'  aligh='right' valign='top'></td>
<td class="form_text">
<select name="Design_Packages"  class='form_text' >
<option value=''>Choose Package</option>
 <option  value="Package A - 1-5x7,2-4x6's,4 wallets $45"   > Package A - 1-5x7,2-4x6's,4 wallets $45
<option  value="Package B - 2-8x10's,2-5x7,2 keychains $75"   > Package B - 2-8x10's,2-5x7,2 keychains $75
<option  value="Package C - 2 different-12x18's + 4 wallets of each picture - $100"   > Package C - 2 different-12x18's + 4 wallets of each picture - $100
<option  value="Package D - 1-16x20,1-8x10 of poster $135 + Action shots 1-8x10,2-5x7's,8 wallets"   > Package D - 1-16x20,1-8x10 of poster $135 + Action shots 1-8x10,2-5x7's,8 wallets
</select>

</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Individual Designs </td><td width='10'  aligh='right' valign='top'></td>
<td class="form_text">
<select name="Individual_Designs"  class='form_text' >
<option value=''>Choose Design</option>
 <option  value="8x10- $45"   > 8x10- $45
<option  value="12x18- $60"   > 12x18- $60
<option  value="16x20- $75"   > 16x20- $75
<option  value="Mouse Pad - $30"   > Mouse Pad - $30
</select>

</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Design Extras</td><td width='10'  aligh='right' valign='top'></td>
<td class="form_text">
<select name="Design_Addon_s_Only"  class='form_text' >
<option value=''>Addon Only</option>
 <option  value="8 wallets - $15"   > 8 wallets - $15
<option  value="2 key chains - $15"   > 2 key chains - $15
<option  value="3 inch button(x2) - $15"   > 3 inch button(x2) - $15
<option  value="4 coasters w/ holder - $45"   > 4 coasters w/ holder - $45
<option  value="10x10 car flag double sided - $40"   > 10x10 car flag double sided - $40
</select>

</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Action Shots</td><td width='10'  aligh='right' valign='top'></td>
<td class="form_text">
<select name="Packages_for_Action_Shots_Only"  class='form_text' >
<option value=''>Choose Package</option>
 <option  value="Package E -  1-5x7,2-4x6's,4 wallets  $15"   > Package E -  1-5x7,2-4x6's,4 wallets  $15
<option  value="Package F -  1-8x10,2-5x7's,2- 4x6's,3 wallets  $30"   > Package F -  1-8x10,2-5x7's,2- 4x6's,3 wallets  $30
</select>

</td>
</tr>

<tr>
<td class="form_field" valign='top' align='right'>Team Packages </td><td width='10'  aligh='right' valign='top'></td>
<td class="form_text">
<select name="Team_Packages"  class='form_text' >
<option value=''>Minimum 7 Players</option>
 <option  value="Package A - 1-5x7, 2-4x6's, 4 wallets $30 (per player)"   > Package A - 1-5x7, 2-4x6's, 4 wallets $30 (per player)
<option  value="Package B - 2-8x10's, 2-5x7, 2 keychains $50 (per player)"   > Package B - 2-8x10's, 2-5x7, 2 keychains $50 (per player)
</select>

</td>
</tr>

<tr><td colspan=3 align='center'><input type='submit' value='Submit'> &nbsp;&nbsp; <input type='button' value='Cancel' onclick="location.href='/';"></td></tr>
</table>

<!--End Form-->
</form>

</div>
Title: Re: form positioning issue
Post by: micah on October 06, 2007, 01:02:57 PM
i dont think its a problem with your form. its your <table> that you've stuffed into a 523px width <div>.   The table cell is word wrapping the text.
Title: Re: form positioning issue
Post by: Steve on October 06, 2007, 03:28:22 PM
u know what, your right. I tested the form outside the div and it was fine. I can tweak it, thanks micah i hadnt thought of that.

:slaps himself: