cancel
Showing results for 
Search instead for 
Did you mean: 

Grouping html Select's

Former Member
0 Kudos

Hello All,

Any idea how to group several html select tags??

Think of a spread sheet, I have 5 rows with one column. A select/option exists in each row of that column. The option values are all the same. A user can select a different option for each row.

What I am trying to do is have an "Apply To All" select box at the very top of the column. If the values are the same for each row, the user could simply select the option from the "apply to all" and that would then fill in all of the select/option boxes in that row. Is there anyway to write a javascript for that if each of the select boxes have a different name?

I know how to do this when I generate a server-side event, but I want to keep this all on the client side.

Any ideas???

Thanks,

Eric

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I don't know if I should be promoting other companies web sites, but for html objects, methods and events I use MS.

http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/dhtml_reference_e...

For javascript, I use to use one from Netscape Devedge, but since that went dead, I goto W3schools. It is a little tougher finding what you want then the netscape one, but it's the best one out there I've ran across.

http://www.w3schools.com/js/default.asp

Former Member
0 Kudos

<script>

function choosebox1(){

document.getElementById("s2").value = document.getElementById("s1").value

document.getElementById("s3").value = document.getElementById("s1").value

document.getElementById("s4").value = document.getElementById("s1").value

}

</script>

<table>

<tr><td><select name=s1 id=s1><option value=1>One</option><option value=2>Two</option><option value=3>Three</option></td><td><INPUT TYPE=button ID=chk1 onclick="choosebox1()" value="Apply To All"></input></td></tr>

<tr><td><select name=s2 id=s2><option value=1>One</option><option value=2>Two</option><option value=3>Three</option></td><td></td></tr>

<tr><td><select name=s3 id=s3><option value=1>One</option><option value=2>Two</option><option value=3>Three</option></td><td></td></tr>

<tr><td><select name=s4 id=s4><option value=1>One</option><option value=2>Two</option><option value=3>Three</option></td><td></td></tr>

</table>