Jump to content

Recommended Posts

Why is it all messed up, I want two drop down menu's which show identical things.

 

Why is the first one fine and the second is messed up?

 

<FORM ACTION="calculate.php" METHOD="POST" onSubmit="return dropdown(this.display)">


<SELECT NAME="display">
<OPTION VALUE="">Choose a Product
<?php
  
while ($row = mysql_fetch_array($result)) {
extract($row);
$productID = $row['vchar_product_id'];
$assesmentLimit = $row['vchar_assessment_limit'];

?>
<OPTION VALUE=<?php "$productID, $assesmentLimit"?> > <?php echo "$productID $assesmentLimit" ?>
<?php
//}
?>
</SELECT>


<SELECT NAME="display2">
<OPTION VALUE="">Choose a Product2
<?php


?>
<OPTION VALUE=<?php "$productID, $assesmentLimit"?> > <?php echo "$productID $assesmentLimit" ?>
</SELECT>

<?php
}
?>
<br /><br /><br /><br />
<INPUT TYPE=SUBMIT VALUE="Calculate">
</FORM>

Link to comment
https://forums.phpfreaks.com/topic/147017-why-is-this-not-showing-correctly/
Share on other sites

Along side that here is a corrected version, you need to use " around values in html or you get errors:

 

<OPTION VALUE="<?php echo "$productID, $assesmentLimit"; ?>"> <?php echo "$productID $assesmentLimit"; ?></OPTION>

 

And it is also good practice to have the </option> Not required, just good practice.

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.