Proble with Menu List and text box Display

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
szms
Forum Contributor
Posts: 101
Joined: Thu Jun 26, 2003 12:23 pm

Proble with Menu List and text box Display

Post 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>
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Actually - having looked at the question again - is this a Javascript or PHP question?

Mac
Post Reply