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
szms
Forum Contributor
Posts: 101 Joined: Thu Jun 26, 2003 12:23 pm
Post
by szms » Fri Jul 18, 2003 8:47 am
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)
{
document.myform.copied.value += str;
}
</script>
<form name='myform'>
<?php
$Domain_Nameї] = Cricket;
$Domain_Nameї] = Soccer;
$Domain_Nameї] = TableTennis;
$Domain_Nameї] = Chess;
?>
<br>
<input type='text' name='copied' value=''>
<select name = "InputDomainMenuї]" Multiple onchange="copythis(this.selectedvalue);">
<?php
foreach ($Domain_Name as $Existing_Item)
print "<option value='{$Existing_Item}'>{$Existing_Item}</option>";
?>
</form>
</html>
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Fri Jul 18, 2003 8:53 am
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
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Fri Jul 18, 2003 8:54 am
Actually - having looked at the question again - is this a Javascript or PHP question?
Mac