Jump to content

php form table help pls


chandler

Recommended Posts

Hi guys, can someone help me with this please. I had this form script made for me but I would like to make some small changes, below is the part I'd like to make changes to. I want to put a <td> tag to the following elements -  (<th>Extras</th>, <td>title</td>, <td>checkbox</td>, <td>personNumber</td>) so that they are all in their own cell. The problem I have is once a new row is made in the form table I am unsure how to make it add the <tr> with php for the new row.

what I get once adding the <td> tags is:

<th>Extras</th>

title checkbox, personNumber title checkbox personNumber

 

what I want is

<th>Extras</th>

title, checkbox, personNumber

title, checkbox, personNumber

 

Here is the code, many thanks for your help!

<table>
<tr>
	<td><?php echo $AB_LANGS['Extras']; ?></td>
	<td align="right">
          	<?php while ($ExtrasData = mysql_fetch_assoc($sql_result)) { ?>
		<?php echo $ExtrasData['title']; ?>
		<input type="checkbox" name="extra_id" id="extra_id" value="<?php echo $ExtrasData['id'] . ':' . $ExtrasData['per'] . ':' . $ExtrasData['price']; ?>" onclick="addExtras()">
		<?php if ($ExtrasData['per'] == 'person') { ?>
		<select name="personNumber_<?php echo $ExtrasData['id']?>" id="personNumber_<?php echo $ExtrasData['id']?>" onchange="addExtras()">
			<?php for($i = 0; $i <= 10; $i++) { ?>
			<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
			<?php } ?>			
		</select>
		<?php } ?>			
		<br/>
		<?php } ?>		
	</td>
</tr>
</table>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.