Page 1 of 1

Proble with Menu List and text box Display

Posted: Fri Jul 18, 2003 8:47 am
by szms
I am having problem with this code. whenever I am selecting any item from list, it's showing undefined in the text box. So could you plese have a look and let me know what do do? Thank you.

Code: Select all

<html> 
<head> 
<title> 
</title> 
</head> 

<script> 
function copythis(str) 
&#123; 
document.myform.copied.value += str; 
&#125; 
</script> 

<form name='myform'> 
<?php 
$Domain_Name&#1111;] = Cricket; 
$Domain_Name&#1111;] = Soccer; 
$Domain_Name&#1111;] = TableTennis; 
$Domain_Name&#1111;] = Chess; 
?> 
<br> 
<input type='text' name='copied' value=''> 
<select name = "InputDomainMenu&#1111;]" Multiple onchange="copythis(this.selectedvalue);"> 

<?php 
foreach ($Domain_Name as $Existing_Item) 
print "<option value='&#123;$Existing_Item&#125;'>&#123;$Existing_Item&#125;</option>"; 
?> 

</form> 
</html>

Posted: Fri Jul 18, 2003 8:53 am
by twigletmac
I have moved this to PHP - Normal as it does not belong in PHP - Advanced. Please take care to post in the most appropriate forum.

Mac

Posted: Fri Jul 18, 2003 8:54 am
by twigletmac
Actually - having looked at the question again - is this a Javascript or PHP question?

Mac