By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,526 Members | 2,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,526 IT Pros & Developers. It's quick & easy.

dynamic multiple selects

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.