By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,665 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

need drop down

P: 3
I need a code that will enable me to let the user pick a color out of a drop down menu. Can anyone help?? I have tried everything and it doesn't seem to work.
Thanks
Lisa
Oct 4 '06 #1
Share this Question
Share on Google+
3 Replies


ronverdonk
Expert 2.5K+
P: 4,258
Here is an example whereby the user can select from 3 colors. However it uses PHP to show what color has been selected. If you do not have or use php, just copy the <form> code.
[PHP]<?php
if (isset($_POST['_submitted'])) {
echo 'You have selected color ' . $_POST['color'];
exit;
}
?>
<form name="MyForm" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Choose a color:
<select name="color" id="color">
<option disabled value="0">choose color</option>
<option value="blue">blue</option>
<option value="yellow">yellow</option>
<option value="red">red</option>
</select>
<input type="submit" value="Select" name="_submitted">
</form> [/PHP]

Ronald :cool:
Oct 4 '06 #2

P: 3
Just wondering if I have small pictures of colors out of a magazine what would I do to get the colors to work. So say I want a customer to be able to pick the color of a shirt that is offered, what would I do to get that
Oct 4 '06 #3

10K+
P: 13,264
Just wondering if I have small pictures of colors out of a magazine what would I do to get the colors to work. So say I want a customer to be able to pick the color of a shirt that is offered, what would I do to get that
Many ways of doing it depending on your chosen representation for the colors.
You could put links on the colored images. Clicking the image would invoke a javascript that sets the color according to the name of the image clicked
Oct 4 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.