Forum Moderators: open

Message Too Old, No Replies

Select the option ( value ) engraving on the data base

<option value="3">..... Show the value

         

romzinho2k7

6:08 am on May 29, 2006 (gmt 0)

10+ Year Member



Good morning friends

I was doing a register form and in him count information as birthday month. It would like that the user could rescue that month ( that gets safe in a database. )

I put this way:

Month Number( Value )
January > 1
February > 2
March > 3
April > 4
...

When the user register, example that choice March, will be engraving the value 3. It would like that if he was to publish, it marked in the form month that he chose. An example:

<select name="month" onChange="this.options[this.selectedIndex].value = 3;">
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
</select>

It would like that the am selected the value 3.

I did this one this.options[this.selectedIndex].value = 3;, but did not work.

Could anybody help?

Thanks

texmex

11:30 pm on May 30, 2006 (gmt 0)

10+ Year Member



you seem to have a serious flaw in your logic. Why give the user a choice, if you then you force their choice to be the third item.

You might just as well have:


<input name="month" type="text" value="3" style="visibility:hidden" >