Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_discuss thread: drop down box


Message #1 by "Milan Shetty" <milanshetty@h...> on Thu, 5 Jul 2001 09:52:02 +0530
Hi ALL,

 I have a drop down box, populated with values from a database table say 

products and on selecting the product should automatically display its 

price somewhere in the form.That is using OnSelect event of the select 

object.Any help would be appreciated.

MS



Message #2 by "ambrose anandraj" <a_anandraj@h...> on Fri, 06 Jul 2001 00:14:19
Hey 



1.There are lot of Methods are there for every selection u can get the 

values for the selected item ( hotmail and other websites are doing but 

for every selection in the combo box it has to refresh the data)...



2. U can store the values for every text property in combo in the value 

property of the combo box with a separator and on change u can take the 

values for the selected text and u can separate the values and dispaly 

whereever u want...



3. Instead of storing in the value property u can store the values in 

a .js file in array then u can get the corresponding values from the js 

files....



Hope these things will help u...



regards



anand







>Subject: drop down box 

>From: "Milan Shetty" 

>Date: Thu, 5 Jul 2001 09:52:02 +0530 

>X-Message-Number: 1 

> 

>Hi ALL, 

> I have a drop down box, populated with values from a database table say = 

>products and on selecting the product should automatically display its = 

>price somewhere in the form.That is using OnSelect event of the select = 

>object.Any help would be appreciated. 

>MS 



Message #3 by "Milan Shetty" <milanshetty@h...> on Fri, 06 Jul 2001 21:14:40 +1000
Anand,

 Thanks a lot, actually i used java script and hidden form fields to get the corresponding value of the drop down box into a text
field. But your suggestion looks very simple and easy.

 

Thanks

Milan

From: "ambrose anandraj"

Reply-To: "asp_discuss"

To: "asp_discuss"

Subject: [asp_discuss] Re: drop down box

Date: Fri, 06 Jul 2001 00:14:19

Hey

1.There are lot of Methods are there for every selection u can get the

values for the selected item ( hotmail and other websites are doing but

for every selection in the combo box it has to refresh the data)...

2. U can store the values for every text property in combo in the value

property of the combo box with a separator and on change u can take the

values for the selected text and u can separate the values and dispaly

whereever u want...

3. Instead of storing in the value property u can store the values in

a .js file in array then u can get the corresponding values from the js

files....

Hope these things will help u...

regards

anand

>Subject: drop down box

>From: "Milan Shetty"

>Date: Thu, 5 Jul 2001 09:52:02 +0530

>X-Message-Number: 1

>

>Hi ALL,

> I have a drop down box, populated with values from a database table say 

>products and on selecting the product should automatically display its 

>price somewhere in the form.That is using OnSelect event of the select 

>object.Any help would be appreciated.

>MS
Message #4 by "Bisht" <bisht@m...> on Tue, 17 Jul 2001 11:32:35 +0530
Plz use java script function like

document.formName.fieldName.value=document.formName.SelectOptionName.selecte

dIndex ;



Hope this will help you.



----- Original Message -----

From: "Milan Shetty" <milanshetty@h...>

To: "asp_discuss" <asp_discuss@p...>

Sent: Thursday, July 05, 2001 9:52 AM

Subject: [asp_discuss] drop down box





Hi ALL,

 I have a drop down box, populated with values from a database table say

products and on selecting the product should automatically display its price

somewhere in the form.That is using OnSelect event of the select object.Any

help would be appreciated.

MS



Message #5 by Vincent Vandermeeren <vincentvdm@O...> on Tue, 17 Jul 2001 10:28:08 +0200
this is a script what is used one of the intranetsites who I've made



It asks all the data out of the database and when you click,he shows the

picture of the product he wants to see.

I think that's what you wanted ??

...if no use this example...



<form>

<div align="center"> 

<select name=menu

onChange=top.location.href=this.form.menu.options[this.form.menu.selectedInd

ex].value>

<option selected>Navigatie</option>

<option value="javascript:addbookmark()">bookmark</option>

</select>

</div>

</form>



...if yes: see the code below



<form>

<div align="center"> 

<select name=menu

onChange=top.location.href=this.form.menu.options[this.form.menu.selectedInd

ex].value>

<option selected>Plz select a product</option>

<%

Dim oConn

Dim oRs

Dim sConstr



Set oConn = server.createobject ("adodb.connection")

Set oRs = server.createobject("adodb.recordset")



oConn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;User

ID=Admin;Mode=Share Deny None;Extended Properties="""";Jet OLEDB:System

database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database

Password="""";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet

OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet

OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet

OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on

Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet

OLEDB:SFP=False;User Id=Admin;PASSWORD=;Data Source=" &

Server.MapPath("db/products")

oConn.connectiontimeout = 30

oConn.open 

oRs.activeconnection = oConn

oRs.open "select * from productlist order by id"

Do Until oRs.EOF

%>

<option

value="show_product.asp?productid=<%=oRs("id")%>"><%=oRs("name_productcaterg

orie")%>

<%

oRs.MoveNext

Loop

oRs.close

oConn.close

%>  

</Select>



----- Original Message -----

From: "Milan Shetty" <milanshetty@h...>

To: "asp_discuss" <asp_discuss@p...>

Sent: Thursday, July 05, 2001 9:52 AM

Subject: [asp_discuss] drop down box





Hi ALL,

 I have a drop down box, populated with values from a database table say

products and on selecting the product should automatically display its price

somewhere in the form.That is using OnSelect event of the select object.Any

help would be appreciated.

MS








  Return to Index