[jQuery] Making a <select> to an <input> where value changes
Hi there!
I am having a bit of a problem with a few <select>'s on my page.
I like the function of them but I think they look like crap.
So I was thinking that maybe jQuery could make it look a bit more to
my liking.
What I was thinking is that I take the regular input of the <select>
and put the first in the order in a <input type="text"> then I place a
+ and - sign in front and after the input.
- <input type="text" name="select" value="first"> +
Then if you press the + or - the javascript loops through the
differens options avalible.
At maximum or minimum it stops or loops through the options again.
The information comes from a database through PHP so it can be put in
the javascript and used that way, but since I am so new to javascript
I can't d othis.
Maybe somone can help me.
If you didn't understand I will try again:
I want the javascript to take the content of a <select> as this one:
<select name="select">
<option value="1">first</option>
<option value="2">second</option>
<option value="3">third</option>
</select>
From that the javascript creates an <input> like this:
- <input type="text" name="select" value="first"> +
If someone presses the + sign the input should become this instead:
- <input type="text" name="select" value="second"> +
So it loops through the <select> in the <input>
The only problem I can think of is how to also include the value from
the option.
-----
Best regards
XeroXer