I am working on an inventory system and here is what the page looks like, minus the pertinent confidential information that I am not allowed to show buttonProblems yes the information displayed is all mock data. however the problem lies in the buttons. On the far right of each vehicles information there are 4 buttons stacked on top of each other, the problem is that no matter which set of buttons I hover over only the fist vehicles set changes. buttonProblems2 each vehicle data table is wrapped in its own form and should be seperate entities, here is the code for the posts:

<td colspan="10" rowspan="22">
        <div id="invScroll">
         <?php
        for($i=0; $i<$row = mysql_fetch_array($sql); $i++)
        {
            ?>
            <form id="inventory" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">
            <table id="inventory" width="793" height="161" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td rowspan="6">
                <img src="<?php echo 'pics/' . $row['main_img']; ?>" width="212" height="120" border="0"></td>
                <td rowspan="8">
                <div id="infoBack">
                <table height="162" width="445" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                    <font face="bankgthd" color="#CC0000" size="+2">
                    <b>
                    &nbsp;
                    Price: $<?php echo $row['ask_price']; ?>
                    </b>
                    </font>
                    </td>
                    <td>
                    <font face="bankgthd" color="#000000" size="+2">
                    <b>
                    <?php echo $row['make']; ?>
                    </b>
                    </font>
                    </td>
                    <td rowspan="7">
                    </td>
                </tr>
                <tr>
                    <td>
                    <font face="bankgthd" color="#000000" size="+1">
                    <b>
                    &nbsp;
                    <?php echo $row['year']; ?>
                    </b>
                    </font>
                    </td>
                    <td>
                    <font face="bankgthd" color="#000000" size="+1">
                    <b>
                    <?php echo $row['model']; ?>
                    </b>
                    </font>
                    </td>
                </tr>
                <tr>
                    <td>
                    <font face="bankgthd" color="#000000" size="+1">
                    <b>
                    &nbsp;
                    <?php echo $row['drive_train']; ?>
                    </b>
                    </font>
                    </td>
                    <td>
                    <font face="bankgthd" color="#000000" size="+1">
                    <b>
                    Ext. Color: <?php echo $row['ext_color']; ?>
                    </b>
                    </font>
                    </td>
                </tr>
                <tr>
                    <td>
                     <font face="bankgthd" color="#000000">
                    <b>
                    &nbsp;
                    Int. Color: <?php echo $row['int_color']; ?>
                    </b>
                    </font>
                    </td>
                    <td rowspan="2">
                    <font face="bankgthd" color="#000000">
                    <b>
                    <?php echo $row['comment']; ?>
                    </b>
                    </font>
                    </td>
                </tr>
                <tr>
                    <td>
                    <font face="bankgthd" color="#000000" size="+1">
                    <b>
                    &nbsp;
                    <?php echo $row['transmition']; ?>
                    </b>
                    </font>
                    </td>
                </tr>
                <tr>
                    <td>
                    <font face="bankgthd" color="#000000" size="+1">
                    <b>
                    &nbsp;
                    Mileage: <?php echo $row['mileage']; ?>
                    </b>
                    </font>
                    </td>
                    <td rowspan="2">
                    <font face="bankgthd" color="#000000" size="+1">
                    <b>
                    <?php echo $row['equipment']; ?>
                    </b>
                    </font>
                    </td>
                </tr>
                </table>
            </div>
            </td>
                <td colspan="3">
                <img src="images/invCutsBase_03.jpg" width="136" height="12" border="0" padding="0"></td>
                <td>
                <img src="images/spacer.gif" width="1" height="12"></td>
            </tr>
            <tr>
                <td colspan="2">
                <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('spec','','images/buttons/invSpecOver.jpg',1)"><img src="images/buttons/invSpec.jpg" width="120" height="31" id="spec" border="0" padding="0"></a></td>
                <td rowspan="7">
                <img src="images/invCutsBase_05.jpg" width="16" height="150" border="0" padding="0"></td>
                <td>
                <img src="images/spacer.gif" width="1" height="31"></td>
            </tr>
            <tr>
                <td colspan="2">
                <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('offer','','images/buttons/invOffOver.jpg',1)"><img src="images/buttons/invOff.jpg" width="120" height="31" id="offer" border="0" padding="0"></a></td>
                <td>
                <img src="images/spacer.gif" width="1" height="31"></td>
            </tr>
            <tr>
                <td colspan="2">
                <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('getInfo','','images/buttons/invGetOver.jpg',1)"><img src="images/buttons/invGet.jpg" width="120" height="31" id="getInfo" border="0" padding="0"></a></td>
                <td>
                <img src="images/spacer.gif" width="1" height="31"></td>
            </tr>
            <tr>
                <td colspan="2">
                <img src="images/invCutsBase_08.jpg" width="120" height="2" border="0" padding="0"></td>
                <td>
                <img src="images/spacer.gif" width="1" height="2"></td>
            </tr>
            <tr>
                <td rowspan="3">
                <img src="images/invCutsBase_09.jpg" width="4" height="54" border="0" padding="0"></td>
                <td rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('carFax','','images/buttons/carfaxOver.jpg',1)"><img src="images/buttons/carfax.jpg" width="116" height="45" id="carFax" border="0" padding="0"></a></td>
                <td>
                <img src="images/spacer.gif" width="1" height="12"></td>
            </tr>
            <tr>
                <td rowspan="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('deets','','images/buttons/detailsOver.jpg',1)"><img src="images/buttons/details.jpg" width="212" height="42" id="deets" border="0" padding="0"></a></td>
                <td>
                <img src="images/spacer.gif" width="1" height="32"></td>
            </tr>
            <tr>
                <td>
                <img src="images/invCutsBase_12.jpg" width="116" height="10" border="0" padding="0"></td>
                <td>
                <img src="images/spacer.gif" width="1" height="10"></td>
            </tr>
            </table>
            </form>
            <?php
        }
        ?>
        </div>
        </td>

thanks for any help.

Recommended Answers

All 2 Replies

Member Avatar for diafol

Urgh - sorry - just saw the rollover js and all the old, old html. Why not use CSS sprites? The following really has no place in modern design:

<td>
<font face="bankgthd" color="#000000" size="+2">
 <b>
 <?php echo $row['make']; ?>
 </b>
 </font>
</td> 

It's very inflexible and maintenance is a grinch. How's this?

<td class="make"><?php echo $row['make']; ?></td> 

And then in your CSS:

.make{
   font-family: bankgthd;
   color: #000000;
   font-size: 1.6em; //or whatever it should be
   font-weight: bold;
}

I can't profess to have looked carefully at your code, but when you get stuff happening on the first instance only, it may be down to identical id attribute values. For example:

id="offer"

This seems to be repeated in each form. Note that ids must be unique for the PAGE/DOCUMENT, not just in a form container.

As I mentioned earlier, using CSS sprites should uncomplicate this and allow you to remove js. Work off the CSS a:link, a:visited, a:hover, a:active with background position.

This post would probably be better in Web Design, HTML and CSS, as it doesn't really involve the php itself, other than the loop.

ok thanks D that helps a lot, I figured it was something like that was just having a hard time pinpointing where I went wrong, and as far as my HTML code, I learned HTML like 3 years ago so I am working off that knowledge while I learn the new stuff. Thanks again, I am working on updating my coding knowledge base.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.