Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting results from a dynamic selction

Status
Not open for further replies.

solo7

Technical User
Mar 14, 2001
243
NO
Ok. I've managed to get this far with the help of F1 and help forums so you can assume correctly that I'm struggeling with VBScript and ASP.
I have two dynamic combo boxes which are working perfectly, one filtering the other. I now need to take the selected result of the second combo box and display the individual record to which the combined selection of the two combo boxes relates. I 'think' I can use SQL to do a SELECT ... WHERE query - or I 'think' I could store the unique index alongside the selected value of the second combo box. But I have 15 fields (idealy to be displayed in 5 rows of 3) and I don't think I can do this with a list box (which is what the main FAQ's are dealing with).
My questions are:- how do I pass the unique index (or selected combo values) to a function to perform the query?
(I've used the DreamWeaver UltraDev4 VBScript example to get this far)
How do I get the 15 fields returned to be displayed in 5 rows of 3?

I'm trying to swim here by relating this project to VB and VBA with which I'm farmiliar, but I't hard teaching yourself!

Steady ... [thumbsup2]
 
1st answer :
In Start.HTML code :
Code:
<Script language=&quot;JScript&quot;>
function send() {
  document.myForm.action = &quot;finish.asp?first=&quot; + document.myForm.first.value + &quot;&second=&quot; + document.myForm.second.value;
  document.myForm.submit;
}
</Script>
...
<FORM name=&quot;myForm&quot; method=&quot;post&quot;>
...
<Select name=&quot;first&quot;>
...
</select>
<Select name=&quot;second&quot;>
...
</select>
<Input type=&quot;button&quot; value=&quot;send&quot; onclick=&quot;send();&quot;>
In finish.asp code :
Code:
<%
first = request.queryString(&quot;first&quot;)
second = request.queryString(&quot;second&quot;)
%>

for the second one, create dynamicaly a table :
Code:
...
<Table>
<TR>
<%
    Sql = &quot;SELECT fieldname FROM ...&quot;
    rs.Open Sql, cnx
    
    num=1
    If Not rs.EOF Then
       rs.MoveFirst
       while Not rs.EOF
           if num > 5 then
              num = 1
              response.write(&quot;</TR><TR>&quot;)
              response.write(&quot;<TD>&quot; & rs.fields(&quot;fieldname&quot;) & &quot;</TD>&quot;)
           else
              num = num + 1
              response.write(&quot;<TD>&quot; & rs.fields(&quot;fieldname&quot;) & &quot;</TD>&quot;)
           end if
       Wend
        .Close
    End if
</TR></TABLE>
%>

hope that helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top