PDA

View Full Version : a html and php conflict question


2bz2p
06-30-2008, 05:31 PM
Hello,

My issue is that if I put the feildset and legend within the do while loop it repeats them, and if I leave the outside of the form tags they do not sit right with in there container. so I am wonder if there is a way to add them inside the form, and prevent the do while statement to repeat them.

code below:

<fieldset>
<legend>Edit/Delete HUB</legend>
<?php do{
?>
<form name="edhubs" method="post" action="<?php $_SERVER['PHP_SELF'] ;?>" >
<table width="94%" border="0" cellpadding="2" cellspacing="3">
<!--DWLayoutTable-->
<tr>
<td width="376" height="28" valign="top"><label>
<input name="airline_hub" type="text" id="airline_hub" value="<?php echo $row_hubs['hub']; ?>" size="50" maxlength="4">
<input name="hub_id" type="hidden" id="hub_id" value="<?php echo $row_hubs['id']; ?>"></label></td>
<td width="169" align="right" valign="top"><label>
<input name="edit_hub" type="submit" id="edit_hub" value="Edit">
<input name="delete_hub" type="submit" id="delete_hub" value="Delete"> </label></td>
</tr>
</table>
</form>
<?php } while($row_hubs = mysql_fetch_assoc ($hubs))?>
<?php
// print the navigation link
if ($rowsPerPage < $numrows){
echo '<div class="page">';
echo $first . $prev .
"Page $pageNum of $maxPage Pages " . $next . $last;
echo '</div>';
}
?>
</fieldset>

Thanks
2b

davidj
06-30-2008, 05:55 PM
add a div inside the fieldset / legend but outside the loop and CSS the mutha

see if that helps

2bz2p
06-30-2008, 06:01 PM
add a div inside the fieldset / legend but outside the loop and CSS the mutha

see if that helps
I dont get what you mean.

davidj
06-30-2008, 06:09 PM
wait

you need the form outside the loop also as there will be multiple forms which wont post (only the first will post)

davidj
06-30-2008, 06:10 PM
are you using vista?

2bz2p
06-30-2008, 06:21 PM
wait

you need the form outside the loop also as there will be multiple forms which wont post (only the first will post)

I need the multiple forms because its one form to edit/delete hub id1 and another to edit/delete hub id2 and so on. when I had the tag outside the loop it would only post on the 3 hub down and only when I change that one.
Any other would just refresh the screen with no database changes.

are you using vista?

No XP

davidj
06-30-2008, 06:28 PM
can you post a screenshot to explain what it looks like

2bz2p
06-30-2008, 06:39 PM
add a div inside the fieldset / legend but outside the loop and CSS the mutha

see if that helps

I get what your saying now, I tried to recreate the feildset and legend using css and when I went back to look at it I got what your were saying.


<div id=box>
<feildset>
<legend>blah</legend>
do
form
while
</feildset>
</div>


Thanks agian
2b

2bz2p
06-30-2008, 06:40 PM
can you post a screenshot to explain what it looks like

When I get home later I will post it both ways, this way if someone run across it again it will be there.

domedia
06-30-2008, 07:16 PM
The DIV around the FIELDSET seems redundant..

2bz2p
06-30-2008, 08:10 PM
I agree but in this instance its a must have (in my opinion) to see below.

this code goes to SS with_div.jpg

<?php /* draw out the hubs*/ ?>
<div id="form_box">
<fieldset>
<legend>Edit/Delete Aircraft</legend>
<?php do{
?>
<form>
html stuff
</form>
<?php } while($row_fleet = mysql_fetch_assoc ($fleet))?>
?>
</fieldset>
</div>


Code goes with SS withoput_div.jpg


<fieldset>
<legend>Edit/Delete Aircraft</legend>
<?php do{
?>
<form>
HTML CODE
</form>
<?php } while($row_fleet = mysql_fetch_assoc ($fleet))?>
</fieldset>



There is some margins with the Form_box div.

2b

domedia
06-30-2008, 08:25 PM
You're nesting 2 boxes for no reason :) That is redundant

Just add the margins to your FIELDSET and delete the DIV. The DIV has no function other than cluttering up your markup.

2bz2p
06-30-2008, 08:42 PM
I feel like a dope, You make complete and total sense, I didnt think of that.

Thanks,
2b

domedia
07-01-2008, 12:48 PM
I feel like a dope, You make complete and total sense, I didnt think of that. I'm glad you saw it as well :) Your code was just fine, but sometimes I like to optimize everything. 8)

davidj
07-01-2008, 01:24 PM
missed it

shite

2bz2p
07-01-2008, 10:02 PM
yeah the best part is I already had the <feildset> cssed lol.