View Single Post
  #1 (permalink)  
Old Aug 18th, 2006, 14:02
antonyx antonyx is offline
Junior Member
Join Date: Dec 2005
Age: 25
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
display on the page an item selected with a form drop down

ok.. i would like to display on my page what item my user has just selected from the form..

eg. which radio button they just chose, or which drop down menu item they have shown..

the page is here..
http://www.londonheathrowcars.com/ajax/blankquote.asp

u can see the

Pickup: Heathrow Airport

is static and unchanging on the right hand side of the page.

if you choose London Postcode, then a drop down menu appears..

i would like the chosen value of the drop down to be displayed where Destination: is (on the right hand side of the page below Pickup: Heathrow Airport).. similarly i would like the type of car to be displayed next to vehicle.

HOWEVER! i am using ajax and the postcodes and car types are in separate asp pages loaded into containers (table cells)..

they are not found directly on the blankquote.asp page.. will this be a problem

if we can just test just one of the things to see if it works..

basically the quote1.asp page is a drop down menu of London Postcodes populated from my database..

this is the page with the drop down menu.
Code: Select all
<%
set myconn = Server.CreateObject("ADODB.connection")
connection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &_
Server.MapPath("/_db_import/prices.mdb") & ";"
myconn.open (connection)

set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select townNAME from tblTOWN", myconn
%>
<script type="text/javascript" src="ajax.js"></script>
<p class="mainbody">2. Select a <b>London Postcode</b>:<br>
    <select class="droppy" name="postcode" onChange="LoadCarContent();">
<option value="">...</option>
<%
if not rs.eof then
do until rs.eof
%>
<option class="grey" value="<%=rs("townName")%>"><%=rs("townName")%></option>
<%
rs.movenext
loop
end if
%>
</select>
</p>
now if we can tell this page to use this value and send it to the bold section of my main page below.. can this be done..

blankquote.asp
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
<title> | </title>

<meta name="description" content="">
<meta name="keywords" content="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="ajax.js"></script>



</head>

<body>
<div id="wrap">
        
        

<div id="bleft">
<h1 class="top">Quick Quote</h1>
<form name="quoteform">


<table width="100%" border="0" cellspacing="0">
  <tr>
    <td id="thecellid"><p class="mainbody">1. Please Choose a Destination:<br><Br>
        <input type="radio" VALUE="v1" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadPostcodes();">&nbsp;&nbsp;&nbsp;<b>London Postcode</b> (N1, WC2, E14 etc..)<br><br>

        <input type="radio" VALUE="v2" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadContent2()";>&nbsp;&nbsp;&nbsp;<b>Town / Location</b> (Cambridge, Brighton etc..)<br><br>
        
        <input type="radio" VALUE="v3" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadAirports()";>&nbsp;&nbsp;&nbsp;<b>UK Airport</b> (Gatwick, Stansted etc..)<br><br>
        
        <input type="radio" VALUE="v4" name="r1" onMouseOver="style.cursor='pointer'" onclick="LoadSeaports()";>&nbsp;&nbsp;&nbsp;<b>UK Seaport</b> (Dover, Harwich etc..)<br><br></td>
  </tr>

  <tr>
    <td id="carcontentid"></td>
  </tr>
</table>
</form>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</div>


<div id="bright">
<h1 class="top">Your Journey</h1>
<form>
<p class="mainbody">Pickup: <b>Heathrow Airport</b><br><br>
Destination: *display chosen postcode here*<br><br>Vehicle:<br><br>
<table width="100%" border="0" cellspacing="0">
  <tr>
<td id="buttonid"></td>
  </tr>
</table>


</p>

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</form>

</div>


            
</div>
</body>
</html>
Reply With Quote