selectboxes in html....?

Hi.

I made it so that my select box populates itself with data from 2 different fields in my database...so the data inside it looks like this:

100-12345 | project 1
100-13456 | project 2

...and etc.

the code to do this is simply just:

$f.='<option value= "'.$row['ProjectID'].'">' . $row['ProjectID'] .' | '. $row['ProjectName']. '</option>';

my question is hard to explain, so try to bare withe lol..

ok. so what I want is for the select box to only show the number (100-12345 for example) when the box is unselected. so if you arent clicked on the box, all you will see is 100-12345, but then when you click on the box, you will see it formatted how I have above with:

project number | project name

is there a way that when the box is unselected it will only show the one? and then once you click it to chose one you can see both (this just makes it easier to make sure you have the correct project selected - being able to see the name and number.

hopefully that makes a bit of sense... !!

thanks!
ya, i thought about that, but yeah lol

i guess ill give'r...although now that I think about it, a tool tip may be nicer looking..the text is just so long sometimes, the box is over half the screen wide!
 
Back
Top