Current location: Hot Scripts Forums » Programming Languages » ASP » HTML/ASP search form to display Access DB data


HTML/ASP search form to display Access DB data

Reply
  #1 (permalink)  
Old 06-16-08, 02:05 PM
williega williega is offline
New Member
 
Join Date: Jun 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
HTML/ASP search form to display Access DB data

Hello,

Can anybody point me to a HTML/ASP search form out there that I can edit to allow multiple pull down menues to search my access db and display results? Sample form where user selects:

Pull Down1
City:
New York
Tulsa
San Diego

Pull Down2
State:
NY
OK
CA

Pull Down3
Cuisine:
Italian
American
Japanese

I found this one but it does not help me.
http://www.activeserverpages.com/glenncook/

thx
Willie
Reply With Quote
  #2 (permalink)  
Old 06-16-08, 11:05 PM
jha jha is offline
Newbie Coder
 
Join Date: Jun 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
you have to use onchange event
like onChange="this.form.submit();
Try


vbnet Code:
  1. <tr><td>field1</td>
  2.    <th width=5%>:</th>
  3. <td>
  4. <% Set RS3=con.Execute("select *from table where field='"&field1&"'") %>
  5.         <select Id="field1" Name="field1" onChange="this.form.submit();">
  6.         <option value="ALL">[Select]</option>
  7.             <% while not rs3.eof %>
  8.         <option value=<%=rs3("field1")%>><%=rs3("field1")%></option>
  9.             <%
  10.             rs3.movenext
  11.             wend
  12.             Rs3.close
  13.             session("field1")=Request.Form("field1")
  14.             if SEssion("field1")<>"" then
  15.            
  16.            Set RS3=con.Execute("select *from table where deptcode='"&session("field1")&"'")   %>
  17.         <option value=<%=rs3("field1")%> selected ><%=rs3("field1")%></option>
  18.          <%end if%>
  19.          </select></td>
  20.          </tr>
  21.          
  22.            <tr>
  23.     <td width=15%> <font  color="#0000FF"><b>Field2 </td>
  24.     <th width=5%>:</th>
  25.     <td>
  26. <% 
  27.             Set RS=CON.Execute("select * from table where field='"&session("field1")&"'" )
  28.  
  29.             %>
  30.  
  31.         <select Id="Sect" Name="sect" onChange="this.form.submit();">
  32.         <option value="ALL">[Select field2]</option>
  33.             <% while not rs.eof %>
  34.         <option value=<%=rs("field2")%> ><%=rs("field2")%></option>
  35.         </option>
  36.             <%
  37.             rs.movenext
  38.             wend
  39.             Rs.close
  40.             session("field2")=Request.Form("field2")
  41.             if SEssion("field1")<>"" then
  42.             IF session("field2")<>"ALL" THEN
  43.            
  44.            Set RS=con.Execute("select *from table where  field='"&session("field2")&"' ")         %>
  45.         <option value=<%=rs("field2")%> selected ><%=rs("field2")%></option>
  46.          <%
  47.          end if
  48.          end if
  49.             %> 
  50.          </select></td>
  51.          </tr>
let us know it help you ............
Regards
jha

Last edited by Nico; 06-17-08 at 02:38 AM. Reason: Wrappers.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form data to data base boxkites Script Requests 0 05-02-06 02:56 AM
How to Display Data in Columns php-learner PHP 3 02-17-06 03:45 AM
How to I receive dynamic data from a web form? Whipsmack JavaScript 9 05-28-04 01:49 PM
Declared Functions skipper23 PHP 4 12-17-03 10:06 AM
index page not showing up skipper23 PHP 3 12-15-03 01:10 PM


All times are GMT -5. The time now is 04:01 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.