470,648 Members | 1,519 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,648 developers. It's quick & easy.

dynamic multiple selects

Holas,

I want to do the following:
If one entry in multiple select "domain" is selected, i want to change
the content in dropdown "typ" dynamically according to the selected
domain.

If more than one entries in domain are selected, i want the dropdown
typ to disappear

here the javaScriptCode that causes an "typ has no properties" -Error:
<script language="Javascript">
<!-- Start
function updateType()
{
domain = document.forms["frm"].elements["txtDomain"];
typ = document.forms["frm"].elements["txtType"];

typ.options.length = 0; // DropDown Menü entleeren

if (domain.options
[domain.selectedIndex].
value == "Email")
{
typ.options[0] = new Option("Software");
typ.options[1] = new Option("Anbieter");
}
else if (domain.options
[domain.selectedIndex].
value == "Internet")
{
typ.options[0] = new Option("Internetzugang");
typ.options[1] = new Option("Webseiten erstellen");
}
}
// Ende -->
</script>

here the multi selects:

<tr class="color1">
<td>Domain: (Mehrfachauswahl mit <br/>gedrückter Strg-Taste
möglich)</TD>
<td colspan="2">
<SELECT size=3 name="txtDomain[]" multiple="multiple"
onchange="updateType()">
<OPTION value=0 selected> alle </OPTION>
<?
while ($arrDomain = mysql_fetch_array($rsDomain))
{
echo("<OPTION value=".$arrDomain["ID"]."> ".$arrDomain["Name"]."
</OPTION>");
}
?>
</SELECT>
</TD>
</TR>

<tr class="color1">
<td>Type: (Mehrfachauswahl mit <br/>gedrückter Strg-Taste
möglich)</TD>
<td colspan="2">
<SELECT size=3 name="txtType[]" multiple="multiple">
<OPTION value=0 selected> alle </OPTION>
</SELECT>
</TD>
</TR>

I would appreciate any help..
thank you very much

Dennis

Aug 8 '05 #1
1 1682
d.********@gmx.net wrote:
Holas,

I want to do the following:
If one entry in multiple select "domain" is selected, i want to change
the content in dropdown "typ" dynamically according to the selected
domain.

If more than one entries in domain are selected, i want the dropdown
typ to disappear

here the javaScriptCode that causes an "typ has no properties" -Error:
<script language="Javascript">
<!-- Start
function updateType()
{
domain = document.forms["frm"].elements["txtDomain"];
domain = document.forms["frm"].elements["txtDomain[]"];

typ = document.forms["frm"].elements["txtType"];
typ = document.forms["frm"].elements["txtType[]"];

No?

Mick

[snip]
Aug 9 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Marc | last post: by
13 posts views Thread by mr_burns | last post: by
2 posts views Thread by rehevkor5 | last post: by
4 posts views Thread by phcmi | last post: by
1 post views Thread by Korara | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.