I have a database. One table is the products table. It has id, product name, description, etc.
On my page I have a combobox where I list all the products, populated from the database. This is done using vbscript. Now when the user selects a product I want a textbox titled description to populate with the description of that product in the db. So basically I need to get users selection, go into the db,
"select decription from products where product_name=" & myForm.products.value
get the decription, populate the textbox.
I got the selection using javascript (Can ir be done in VBScript?). But now I can't connect to the db using javascript, I need to use vbscript (because it is client side...) so how do I mix the code?
Code:
<select name="products" id="products" onChange="PopulateDesc(myForm.products.value)">
<% dim j
for j=lbound(arrProducts) to ubound(arrProducts)%>
<option value="<%=arrProducts(j)%>"><%=arrProducts(j)%> </option>
<%next%>
</select>
Thanks!