If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > FileMaker > help me with javascrip

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-31-05, 14:08
yyu yyu is offline
Registered User
 
Join Date: Mar 2004
Posts: 660
help me with javascrip

I would like to once select Apple, it will display value 10, once select Orange, it iwll display value 20, or once select Pear, it will display 30. But now it didn't work, i blieve, the syntax has problem:

if mylist.options[mylist.selectedIndex]==0
y.value=10

Can you help me to check this ? Thansk.

<html>
<head>
<script type="text/javascript">
function favBrowser()
{
var mylist=document.getElementById("myList")

var y =document.getElementById("favorite")


if mylist.options[mylist.selectedIndex]==0
y.value=10


if mylist.options[mylist.selectedIndex]==1
y.value=20


if mylist.options[mylist.selectedIndex]==2
y.value=30

}
</script>
</head>

<body>
<cfform>
Select your favorite browser:
<select id="myList" onchange="favBrowser()">
<option>Apple</option>
<option>Orange</option>
<option>Pear</option>
</select>
<p>Your favorite browser is: <input type="text" id="favorite" size="20"></p>
</cfform>
</body>

</html>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On