Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 selection of combo box in asp

views
     
shinchan^^
post Feb 6 2006, 04:44 PM

K66
*********
All Stars
21,256 posts

Joined: Jan 2003
From: Pekopon


CODE
<select Name="fruitName">
 <%do while not resultSetFruit.eof=true
     Response.Write "<option value=" & resultSetFruit("FruitName") & ">" & resultSetFruit("FruitName") & "</option>"

     resultSetFruit.MoveNext
           loop %>
             </select>

shinchan^^
post Feb 6 2006, 05:08 PM

K66
*********
All Stars
21,256 posts

Joined: Jan 2003
From: Pekopon


make a submit type button then the page form action post back to same page

asp top page detect post back and fruitname and update table


or use a javascript function detect the combobox change, and post back
then do the update


i think use button better

shinchan^^
post Feb 6 2006, 05:13 PM

K66
*********
All Stars
21,256 posts

Joined: Jan 2003
From: Pekopon


1st)
<FORM NAME="fmMain" ACTION="Fruit.asp?fruitName=<%=fruitName%>" METHOD="post" TARGET="_top">

2nd)
<input value ="View Bill" type="submit" name="bttSubmit" />



3rd) 'Request balik the fruitname on the top page
<%@ LANGUAGE="VBSCRIPT" %>

fruitName= Request("fruitName")

if fruitName="" then
Response.Write "<script>alert('Please Select The Fruit Type.')</script>"
else
' SQL UPDATE STATEMENT HERE
'
'
'

end if

%>


 

Change to:
| Lo-Fi Version
0.0155sec    0.16    6 queries    GZIP Disabled
Time is now: 24th December 2025 - 02:38 AM