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
https://forums.phpfreaks.com/topic/258202-php-form-table-help-pls/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.