Forum Moderators: open
How can I set a "default selected" item in a group of raidobuttons, checkboxes and/or select group?
The question is because when I write the code I can tell which element is "selected" or "checked" but if I change it manually on the website and I reload the page, the suppossed "selected" value in the first place isn't selected but the new selected value remains.
Is there any way to define a "default selected" value for this items (radiobutton, checkboxes and select)?
Thank you!
Ale
Ok, for radiobuttons and checkboxes I just have to put "checked" as an attribute.
And for a drop-down list I just have to put "selected".
I do that...
Imagin a drop down list like this one:
<select>
<option selected="selected">1st Option</option>
<option>2nd Option</option>
<option>3rd Option</option>
</selected>
When I load the page the selected item is "1st Option". Then I select "3rd Option" with the mouse(on the webpage, the code remains just like the one above).
The problem is that when I reload the page (pressing F5 or clicking the Reload button on the browser), the selected item is "3rd Option" and no "1st Option" like the code says. The only way I can get the original webpage is to load the page all over again, and for my work right now that is no good.
This happend in FF(Linux/Windows) and IE.
Is there anyway to fix that?
I hope now the question is more clear.
Thank you!