|
-
Feb 27th, 2008, 10:10 PM
#1
Thread Starter
Fanatic Member
Javascript, how to get value of combobox
Dear All,
I am learning javascript and now trying to get the value of selected combo box using below javascript.. but it does not work.. could any body please help?
function JSGetSelectedItem() {
alert("Hello JSCript " + document.form1.select.options(document.form1.select.selectedindex).text);
}
===
and I call it from my PHP codes..
<select name="select" size="1" onchange="JSGetSelectedItem()">
<?php
for ($i=1;$i<=10;$i++)
{
echo "<option>".$i;
}
?>
</select>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|