just trying to creat a line break in a form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chopWood
Forum Commoner
Posts: 45
Joined: Fri Apr 30, 2010 9:28 am

just trying to creat a line break in a form

Post by chopWood »

I can hardly believe I can't do this but...Look at where I make a drop down list of states to select from within a form. No matter what I do, the "zip code" text field appears on the same line as the "states" list. It doesn't matter how many '<p> ' or line breaks I put in. I'm just trying to get the next form element "zip" on a new line. Thanks, Chop.


Code: Select all


<div id="pm" style="display:none;"><p><b>Send my check to:<p><b>Address1:</b> 
        <input type="text" name="address1" size="40" maxlength="40" value="<?php if (isset($trimmed['address1'])) echo $trimmed['address1']; ?>" /></p>
        
        <p><b>Address2:</b> <input type="text" name="address2" size="40" maxlength="40" value="<?php if (isset($trimmed['address2'])) echo $trimmed['address2']; ?>" /> </p>
        
        <p><b>City:</b> <input type="text" name="city" size="20" maxlength="20" value="<?php if (isset($trimmed['city'])) echo $trimmed['city']; ?>" /></p>
        
        
        <!--<b>State:</b> <input type="text" name="state" size="20" maxlength="20" value="<?php //if (isset($trimmed['state'])) echo $trimmed['state']; ?>" /> </p> -->
        
          <!--Make the states drop down list --> 
     <p> <?php echo '<b> State: </b>';
     
	  echo '<select name="state">';
      foreach ($states_arr as $key => $value) {
		  
		  echo "<option value=\"key\">$value</option>\n";
	  }
	   ?></p>
       
        
   <p><b>Zip:</b> <input type="text" name="zip" size="20" maxlength="20" value="<?php if (isset($trimmed['zip'])) echo $trimmed['zip']; ?>" /></p>  </div>
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: just trying to creat a line break in a form

Post by Jade »

You're missing the </select> tag at the end of your states drop down box.

Code: Select all

<p> <?php echo '<b> State: </b>';
     
          echo '<select name="state">';
      foreach ($states_arr as $key => $value) {
                 
                  echo "<option value=\"key\">$value</option>\n";
          }
           ?></select></p>
chopWood
Forum Commoner
Posts: 45
Joined: Fri Apr 30, 2010 9:28 am

Re: just trying to creat a line break in a form

Post by chopWood »

Thanks... I looked at it for an hour and didn't see that :crazy:

chop
Post Reply