• Drop Down box Selection
    13 replies, posted
Im making a website for kilt hire for my work and i've made some drop down boxes, however i was wanting to know how to only allow one selection, and if you select from one drop down, the other 2 go back to the default value. Is this possible? Heres what i've done with a snippet of code: [img]http://i45.tinypic.com/1zcis74.png[/img] (note thats just a snippet of code for the first box, the code for the other 2 boxes is underneath, but very similar)
You would need to use javascript to change two of them to their original value
[QUOTE=wutanggrenad;22978395]You would need to use javascript to change two of them to their original value[/QUOTE]
Can't you just have them all into one using optgroup? [url]http://www.w3schools.com/tags/tag_optgroup.asp[/url] [code]<select name="Tartan"> <optgroup label="Standard Tartans"> <option value="Blah1">Blah1</option> <option value="Blah2">Blah2</option> </optgroup> <optgroup label="Football Tartans"> <option value="Blah3">Blah3</option> <option value="Blah4">Blah4</option> </optgroup> <optgroup label="Premium Tartans"> <option value="Blah5">Blah5</option> <option value="Blah6">Blah6</option> </optgroup> </select>[/code]
[QUOTE=rieda1589;22987431]Can't you just have them all into one using optgroup? [url]http://www.w3schools.com/tags/tag_optgroup.asp[/url] [code]<select name="Tartan"> <optgroup label="Standard Tartans"> <option value="Blah1">Blah1</option> <option value="Blah2">Blah2</option> </optgroup> <optgroup label="Football Tartans"> <option value="Blah3">Blah3</option> <option value="Blah4">Blah4</option> </optgroup> <optgroup label="Premium Tartans"> <option value="Blah5">Blah5</option> <option value="Blah6">Blah6</option> </optgroup> </select>[/code][/QUOTE] Yes you can but it is not as swish/snazzy? :D
[QUOTE=ThePunisher1;22990150]Yes you can but it is not as swish/snazzy? :D[/QUOTE] Makes more sense semantically
[QUOTE=turb_;22996548]Makes more sense semantically[/QUOTE] And it's much more easier to get the value from POST/GET.
[QUOTE=rieda1589;22987431]Can't you just have them all into one using optgroup? [url]http://www.w3schools.com/tags/tag_optgroup.asp[/url] [code]<select name="Tartan"> <optgroup label="Standard Tartans"> <option value="Blah1">Blah1</option> <option value="Blah2">Blah2</option> </optgroup> <optgroup label="Football Tartans"> <option value="Blah3">Blah3</option> <option value="Blah4">Blah4</option> </optgroup> <optgroup label="Premium Tartans"> <option value="Blah5">Blah5</option> <option value="Blah6">Blah6</option> </optgroup> </select>[/code][/QUOTE] That is actually a much better way of doing it, thanks :D
[QUOTE=Neo1607;23017439]That is actually a much better way of doing it, thanks :D[/QUOTE] The web software i am using it with (Nitrosell) must not support optgroup. Because everytime i save it, it saves everything except the optgroup code, any other way of doing this?
It should support it, it's a part of the HTML specification.
[QUOTE=Neo1607;23027485]The web software i am using it with (Nitrosell) must not support optgroup. Because everytime i save it, it saves everything except the optgroup code, any other way of doing this?[/QUOTE] What "software" are you using? Something doesn't ring right here.
NitroSell, it's apparently a eCommerce provider for Microsoft Dynamics.
Yeah, it's a web based package that integrates with "Microsoft Dynamics RMS" which is what we use for a till system, basically it can pull everything from our mySQL stock database and integrate it on the website. Im putting the code into an HTML editor built into the webstore manager, and i have W3C verfied the code, but when i save it, it saves everything except the tags relating to <optgroup>. I might submit a ticket to query it.
Do the select elements have the same name? If so, that might be the problem.
Sorry, you need to Log In to post a reply to this thread.