Showing posts with label selected. Show all posts
Showing posts with label selected. Show all posts

Monday, March 8, 2010

Use Javascipt to change the <select> Pre-select Item

I use this to change:

document.getElementById('idname').selectedIndex = 0;

Tested to work fine with latest IE, Firefox, Safari and Chrome. Your <select> also needs to address the id name such as:

<select id=idname>

You can change the selectedIndex to something else. 0 means the first selection, 1 means the second, etc.
Read More »

Thursday, February 4, 2010

All the Pre-selections and Pre-checks in HTML Selection ie. OPTION and INPUT(Radio+Checkbox)

For Pull-Down Selection:

<select name=country>
<option>Argentina</option>
<option selected>Australia</option>
<option>Austria</option>
<option>Bahamas</option>
.
.
.
</select>


For Radio Selection:

Orange <input type=radio name=type value=apple checked> Apple <input type=radio name=type value=orange>


For Checkbox Selection:

<input type=checkbox name=type checked>



Coming next, how to detect those selections in PERL-CGI script...
Read More »