Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 06-28-2005, 03:07 AM   #1 (permalink)
awieds
Registered User
 
Join Date: Mar 2005
Posts: 42
awieds is on a distinguished road
Combine VBScript and Javascript in asp

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!
awieds is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript Karan HTML, XML, Javascript, AJAX 2 05-26-2005 07:26 PM


All times are GMT -8. The time now is 09:52 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting