Hi
My Uni assignment is to develop a flight Reservation using ASP and Ms Access database. I have started it and got stack with how to code a select from displayed flights using Radio button. I would much appreciate and suggestions:

<table border="1">
<thead><h2><%=(rsOutBound.Fields.Item("deptCity").Value)%> To <%=(rsOutBound.Fields.Item("arrCity").Value)%></h2></thead>
  <tr>
  <% While ((Repeat1__numRows <> 0) AND (NOT rsOutBound.EOF)) %>
    
      <td><b><%= FormatCurrency((rsOutBound.Fields.Item("price").Value), 2, -2, -2, -2) %></b>
      <%=(rsOutBound.Fields.Item("deptDate").Value)%><br/>
      <%=(rsOutBound.Fields.Item("deptTime").Value)%><br/>
      <%=(rsOutBound.Fields.Item("arrTime").Value)%><[B]input name="outBound" type="radio" value="" />[/B]</td>
      
    
    <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rsOutBound.MoveNext()
Wend
%></tr>
</table>
<br/><br/>

</body>
</html>
<%
rsOutBound.Close()
Set rsOutBound = Nothing
%>

whats your problem?
will you use values from forms or do you have problems, connecting a database?

to catch form fields, you shoud use "request"

<%=request.form("outBound"%>
But you didn't give a value. to this field!

whats your problem?
will you use values from forms or do you have problems, connecting a database?

to catch form fields, you shoud use "request"

<%=request.form("outBound"%>
But you didn't give a value. to this field!

Thanks for the quick response. I am able to caatch the input alright. I was not sure if I should give a Value to the field as suggested. In essense I'm using While Loop to pull out results that meets the Form input from a previous page. Then the user has the option to select one of the outbound date of travelling. I have attached a snapshot of a similar Flight booking site for your view. I welcome your suggestions.

i think your problem is the way how to handle your response.

of course, you must give a value to the outbound-Item

try this:
*********************************************

iCounter=0
do while NOT rsOutBound.EOF 
iCounter=iCounter+1
response.write "<td><b>"
response.write FormatCurrency((rsOutBound.Fields.Item("price").Value), 2, -2, -2, -2) 
response.write "</b>"
response.write rsOutBound("deptDate") & "<br/>"
response.write rstOutBound("deptTime")& "<br/>"
response.write rsOutBound("arrTime")  & "<br/>"
sChecked="": if request.form("outBound") = iCounter then sChecked=" checked "
response.write "<input name=""outBound"" "&sChecked&" type="radio" value=""" & iCounter & """ />
response.write "</td>"
rsOutBound.MoveNext
loop

*********************************************

Its better, not do change too often between html and asp-Source. It's faster!

Try it!

Michael

Thanks a lost for your scripts.
Any idea how I could design a 3/4 steps wizard to cater for Outbound, InBound, passenger details and payment.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.