Page 1 of 1

storing combo box value

Posted: Fri Jun 13, 2008 6:14 am
by vb_123
hello friends,
i have a code like this :
<tr>
<td>Task Status :</td>
<td>
<select name="status">
<option value="juststarted">Just Started</option>
<option value="halfcompleted">Half Completed</option>
<option value="almostcompleted">Almost Completed</option>
<option value="completed">Completed</option>
</select>
</td>
</tr>

what is want is when i select a value from combo box (lets say completed) it should display as completed( and not the first value "just started").so how to use isset function for this.............thanx in advance

Re: storing combo box value

Posted: Fri Jun 13, 2008 6:21 am
by VladSun
You'll need to generate this HTML:

Code: Select all

...<option value="completed" selected>Completed</option>...

Re: storing combo box value

Posted: Fri Jun 13, 2008 6:36 am
by vb_123
u r rite but what if i want to select any other value lets say almost completed then........that will not solve my purpose.......please suggest some other option

Re: storing combo box value

Posted: Fri Jun 13, 2008 6:42 am
by VladSun
???
You decide what HTML has to be generated ... so, where is the problem?

Re: storing combo box value

Posted: Fri Jun 13, 2008 6:52 am
by JAB Creations
Almost!

Two things...

1.) This is the PHP code forum and that is not PHP! This thread needs to be moved to the clientside forum. With 9 posts you should know this by now. :|

2.) VladSun is half correct but he's missing the value!

Code: Select all

<option attribute="value"></option><option selected="selected"></option>
I'm pretty sure you want to utilize JavaScript to execute a function when the user changes the value of the select menu.

Code: Select all

<select onchange="my_function();">

Code: Select all

my_function() {alert('The select menu\'s value has changed.');}
...of course you're going to need to learn how to reference things better in order to ask the questions to the required depth in order to receive the answers you desire.

Re: storing combo box value

Posted: Fri Jun 13, 2008 7:02 am
by VladSun
JAB Creations wrote:2.) VladSun is half correct but he's missing the value!
http://www.w3schools.com/Xhtml/xhtml_syntax.asp

Re: storing combo box value

Posted: Fri Jun 13, 2008 1:31 pm
by RobertGonzalez
How does this question have anything to do with PHP?

Re: storing combo box value

Posted: Fri Jun 13, 2008 1:49 pm
by JAB Creations
JAB Creations wrote:This thread needs to be moved to the clientside forum.
Thank you for noticing too. :mrgreen:

Re: storing combo box value

Posted: Fri Jun 13, 2008 2:00 pm
by RobertGonzalez
JAB Creations wrote:
JAB Creations wrote:This thread needs to be moved to the clientside forum.
Thank you for noticing too. :mrgreen:
There may be PHP involved, so I am giving the OP the benefit of the doubt.