Click to See Complete Forum and Search --> : dropdown select action?
joey o.
Nov 17th, 2000, 04:24 PM
Hi,
I'm using VBScript and I was wondering if someone had an example or even advise on grabbing the selected text of a dropdown(not a problem) and updating the page everytime a new selection is chosen(this is my problem). Can anyone help?
monte96
Nov 17th, 2000, 05:13 PM
Depends on what you need to update. If the data is relatively small, you can store it within the page in arrays that have page scope. These arrays can be used to populate other fields and select/option groups based on the selections of another.
Basically you have to create client side code using server side code.
joey o.
Nov 18th, 2000, 09:33 PM
Ok that's helpful but I'm dealing with alot of info in a database. What I really need to know is what action is triggered when I select an option, how can I take the option's value and put it into a Sql statement, and have it executed by the page by recalling itself?
ZeBula8
Jul 12th, 2006, 10:12 PM
you can use the 'OnChange' event for the select object:
<form name="order" method="post">
<select name="products" onchange="doSomething()">
where 'doSomething' is a function that performs your action(s).
<script language="javascript">
function doSomething()
{
var si = document.order.products.selectedIndex;
var partNo = document.order.products.options[si].value;
var desc = document.order.products.options[si].text;
alert("you selected part number " + partNo + ", '" + desc + " ' ");
}
</script>
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.