Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_discuss thread: Simultaneous change


Message #1 by "Dibyendra Hyoju" <dibyendra@y...> on Wed, 30 Oct 2002 14:40:57
How can I use like onChange()  on ASP when The list Is Changed?
Is There Any Way to Get the List Index Or Value In ASP?
Because I wanted the ProductID to appear in the productID field when the 
productName in the ProductName list is changed.
The table products in products.mdb Contains ProductID,ProductName...
When productName List is Changed  corresponding ProductId Sould appear in 
CustomerID Field.
I populated the list through following code.
<select name="ProductName" size="1">
<% 
do while not rs1.eof 
response.write "<option value=" + Cstr(rs1("ProductName")) +">" + rs1
("ProductName")+ "</option>"
rs1.movenext
loop
%>
I tried populating the option value as ProductID and taking the value 
through Javascript but this way gave problem when 

inserting into the database because the productID is assigned to the 
ProductName field.
I avoided putting ProductID as Option Value because When inserting the 
productName,ProductID will be inserted.
So is there any another way like onChange() event or any other in ASP?
I wanted the  corresponding ProductId to appear when the List ProductName 
is changed in the following field.
<INPUT TYPE="text" NAME="productid" value="">

Please Help
I have to complete this project this week.
Dibyendra
Message #2 by "Harnek Singh" <harneksingh@r...> on 30 Oct 2002 17:05:55 -0000
this can be done by making the array in javascript or vbscript 
while loading the page, using asp. so onchange event u can call 
the values of particular array.
harnek

On Wed, 30 Oct 2002 Dibyendra Hyoju wrote :
>How can I use like onChange()  on ASP when The list Is Changed?
>Is There Any Way to Get the List Index Or Value In ASP?
>Because I wanted the ProductID to appear in the productID field 
>when the
>productName in the ProductName list is changed.
>The table products in products.mdb Contains 
>ProductID,ProductName...
>When productName List is Changed  corresponding ProductId Sould 
>appear in
>CustomerID Field.
>I populated the list through following code.
><select name="ProductName" size="1">
><%
>do while not rs1.eof
>response.write "<option value=" + Cstr(rs1("ProductName")) +">" + 
>rs1
>("ProductName")+ "</option>"
>rs1.movenext
>loop
>%>
>I tried populating the option value as ProductID and taking the 
>value
>through Javascript but this way gave problem when
>
>inserting into the database because the productID is assigned to 
>the
>ProductName field.
>I avoided putting ProductID as Option Value because When 
>inserting the
>productName,ProductID will be inserted.
>So is there any another way like onChange() event or any other in 
>ASP?
>I wanted the  corresponding ProductId to appear when the List 
>ProductName
>is changed in the following field.
><INPUT TYPE="text" NAME="productid" value="">
>
>Please Help
>I have to complete this project this week.
>Dibyendra


  Return to Index