freshwaterwest
asked on
spry form select dependent drop-downs - on submit last one is undefined (price) in url (get method)
Created my first spry xml dependent drop down select menus, for:
brand
model
price
When submitted the url contains first 2 values, but last one is undefined:
http://www.qmarketing.co.uk/dd/index1.php?brand_id=1&model=Cosmograph+Daytona&price=undefined&submit=Go
page follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wdg="http://ns.adobe.com/addt">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>David Duggan Watches - London Rolex, Patek Philippe, Cartier and Fine Watch Dealer</title>
<link href="ddmain.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jumpmenu.js"></script >
<script type="text/javascript" src="script/swfobject.js"> </script>
<script src="SpryAssets/xpath.js" type="text/javascript"></s cript>
<script src="SpryAssets/SpryData.j s" type="text/javascript"></s cript>
<script src="SpryAssets/SpryValida tionSelect .js" type="text/javascript"></s cript>
<script type="text/javascript">
var dsBrands = new Spry.Data.XMLDataSet("bran dsxml.php" , "watches/brands",{sortOnLo ad:"url",s ortOrderOn Load:"asce nding",dis tinctOnLoa d:true});
var dsModels = new Spry.Data.XMLDataSet("{dsB rands::url }", "watchmodels/models/model" );
var dsPrices = new Spry.Data.XMLDataSet("pric erange.php ?model={ds Models::mo del}", "watchmodels/models/price_ range",{di stinctOnLo ad:true});
</script>
<link href="SpryAssets/SpryValid ationSelec t.css" rel="stylesheet" type="text/css" />
<?php
$Img1 = "dd-intro00.swf";
$Img2 = "dd-intro00b.swf";
$Img3 = "dd-intro00c.swf";
$Img4 = "dd-intro00d.swf";
$Img5 = "dd-intro00.swf";
$num = rand (1,5);
$Image = ${'Img'.$num};
?>
</head>
<body><div id="container">
<div id="topnav" class="top"><?php include("topnav.shtm") ?>
</div>
<div id="flash1"><img src="images/dd-intro00.jpg " alt="Burlington Arcade 020 7491 1675" width="773" height="288" /></div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("images/<?php echo $Image ?><?php if($_GET['brand_id'] != NULL){ ?>?skip=1<?php } ?>", "david duggan watches", "773", "288", "8", "#748DB5");
so.addParam("wmode", "transparent");
so.addVariable(""); // this line is optional, but this example uses the variable and displays this text inside the flash movie
so.write("flash1");
// ]]>
</script>
<div id="watchnav" class="short"><?php include("navigation.shtm") ?>
<br clear="all" />
</div>
<div id="textarea">
<div class="searchbox"><div class="searchinner">
<a href="watches.php">Click here to view all our watches</a>
<form name="selectForm" method="get" action="">
<label class="labels"><span class="left">Brands:</span >
<span spry:region="dsBrands" id="brandSelector">
<select spry:repeatchildren="dsBra nds" name="brand_id" onchange="document.forms[0 ].model.di sabled = true; dsBrands.setCurrentRowNumb er(this.se lectedInde x);">
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{url}" selected="selected">{brand _name}</op tion>
<option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{url}">{brand_name} </option>
</select>
</span></label>
<label class="labels"><span class="left">Models:</span >
<span spry:region="dsModels" id="modelSelector">
<select spry:repeatchildren="dsMod els" id="model" name="model" onchange="document.forms[0 ].price.di sabled = true; dsModels.setCurrentRowNumb er(this.se lectedInde x);">
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{model}" selected="selected">{model }</option>
<option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{model}">{model}</o ption>
</select>
</span></label>
<label class="labels"><span class="left">Prices:</span >
<span spry:region="dsPrices" id="priceSelector">
<select spry:repeatchildren="dsPri ces" id="price" name="price">
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{price_value}" selected="selected">£ ;{price_ra nge}</opti on>
<option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{price_value}">&pou nd;{price_ range}</op tion>
</select>
</span></label>
<input name="submit" type="submit" id="submit" value="Go" />
</form>
</div>
</div>
<div class="leftcolumn1"><h1><i mg src="images/forthebest.gif " alt="for the best in fine pre-owned timepieces by Rolex, Cartier, Patek Philippe and more..." longdesc="index.php" /><span class="textonly">for the best in fine pre-owned timepieces by Rolex, Cartier, Patek Philippe and more...</span></h1>
<p>Working with some of the world’s leading brands, our team of 6 expert staff has a combined experience of over 150 years. If you’re looking for fine pre-owned time pieces, we regularly deal in <span class="lightblue">Cartier, Vacheron, Panerai, Jaeger-Le-Coultre, Lange & Sohne, International Watch Company</span> and other fine names. However, we have a particular passion for pre-owned <span class="lightblue">Patek Philipe</span> and <span class="lightblue">Rolex</s pan> and are regularly consulted by collectors around the world. </p>
<p><span class="quote"><span class="lightblue"><em>&ldq uo;The best known and most highly respected used watch business in Britain.” </em></span><br />
<strong>QP, fine watch magazine, issue 15, 2005</strong></span></p>
<p><a href="aboutus.php">more about us...</a></p>
</div>
</div>
<br clear="all" />
<?php include("base.shtm") ?>
</div>
</body>
</html>
brand
model
price
When submitted the url contains first 2 values, but last one is undefined:
http://www.qmarketing.co.uk/dd/index1.php?brand_id=1&model=Cosmograph+Daytona&price=undefined&submit=Go
page follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wdg="http://ns.adobe.com/addt">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>David Duggan Watches - London Rolex, Patek Philippe, Cartier and Fine Watch Dealer</title>
<link href="ddmain.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jumpmenu.js"></script
<script type="text/javascript" src="script/swfobject.js">
<script src="SpryAssets/xpath.js" type="text/javascript"></s
<script src="SpryAssets/SpryData.j
<script src="SpryAssets/SpryValida
<script type="text/javascript">
var dsBrands = new Spry.Data.XMLDataSet("bran
var dsModels = new Spry.Data.XMLDataSet("{dsB
var dsPrices = new Spry.Data.XMLDataSet("pric
</script>
<link href="SpryAssets/SpryValid
<?php
$Img1 = "dd-intro00.swf";
$Img2 = "dd-intro00b.swf";
$Img3 = "dd-intro00c.swf";
$Img4 = "dd-intro00d.swf";
$Img5 = "dd-intro00.swf";
$num = rand (1,5);
$Image = ${'Img'.$num};
?>
</head>
<body><div id="container">
<div id="topnav" class="top"><?php include("topnav.shtm") ?>
</div>
<div id="flash1"><img src="images/dd-intro00.jpg
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("images/<?php echo $Image ?><?php if($_GET['brand_id'] != NULL){ ?>?skip=1<?php } ?>", "david duggan watches", "773", "288", "8", "#748DB5");
so.addParam("wmode", "transparent");
so.addVariable(""); // this line is optional, but this example uses the variable and displays this text inside the flash movie
so.write("flash1");
// ]]>
</script>
<div id="watchnav" class="short"><?php include("navigation.shtm")
<br clear="all" />
</div>
<div id="textarea">
<div class="searchbox"><div class="searchinner">
<a href="watches.php">Click here to view all our watches</a>
<form name="selectForm" method="get" action="">
<label class="labels"><span class="left">Brands:</span
<span spry:region="dsBrands" id="brandSelector">
<select spry:repeatchildren="dsBra
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{url}" selected="selected">{brand
<option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{url}">{brand_name}
</select>
</span></label>
<label class="labels"><span class="left">Models:</span
<span spry:region="dsModels" id="modelSelector">
<select spry:repeatchildren="dsMod
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{model}" selected="selected">{model
<option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{model}">{model}</o
</select>
</span></label>
<label class="labels"><span class="left">Prices:</span
<span spry:region="dsPrices" id="priceSelector">
<select spry:repeatchildren="dsPri
<option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}" value="{price_value}" selected="selected">£
<option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" value="{price_value}">&pou
</select>
</span></label>
<input name="submit" type="submit" id="submit" value="Go" />
</form>
</div>
</div>
<div class="leftcolumn1"><h1><i
<p>Working with some of the world’s leading brands, our team of 6 expert staff has a combined experience of over 150 years. If you’re looking for fine pre-owned time pieces, we regularly deal in <span class="lightblue">Cartier,
<p><span class="quote"><span class="lightblue"><em>&ldq
<strong>QP, fine watch magazine, issue 15, 2005</strong></span></p>
<p><a href="aboutus.php">more about us...</a></p>
</div>
</div>
<br clear="all" />
<?php include("base.shtm") ?>
</div>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Jason,
I've managed to get it working (price=5 for example)
Problem now is I can't seem to get it to distinctOnLoad any longer, tried a few variations
http://www.qmarketing.co.uk/dd/index1.php
(I've taken out the form action now so it's easier to see the url on the page)
this is the xml page where the data is coming from:
http://www.qmarketing.co.uk/dd/pricerange.php?model=Cosmograph+Daytona
thanks
Phil
I've managed to get it working (price=5 for example)
Problem now is I can't seem to get it to distinctOnLoad any longer, tried a few variations
http://www.qmarketing.co.uk/dd/index1.php
(I've taken out the form action now so it's easier to see the url on the page)
this is the xml page where the data is coming from:
http://www.qmarketing.co.uk/dd/pricerange.php?model=Cosmograph+Daytona
thanks
Phil
ASKER
sorry thought I should send this to show how I'm getting the data:
<script type="text/javascript">
var dsBrands = new Spry.Data.XMLDataSet("bran dsxml.php" , "watches/brands",{sortOnLo ad:"url",s ortOrderOn Load:"asce nding",dis tinctOnLoa d:true});
var dsModels = new Spry.Data.XMLDataSet("{dsB rands::url }", "watchmodels/models/model" );
var dsPrices = new Spry.Data.XMLDataSet("pric erange.php ?model={ds Models::mo del}", "watchmodels/models","pric e_value"," price_rang e",{distin ctOnLoad:t rue});
</script>
think it might be a case of getting this right?
<script type="text/javascript">
var dsBrands = new Spry.Data.XMLDataSet("bran
var dsModels = new Spry.Data.XMLDataSet("{dsB
var dsPrices = new Spry.Data.XMLDataSet("pric
</script>
think it might be a case of getting this right?
ASKER
think I've managed to sort it thanks... I needed to come back up a node-level in my link and not list the fields in there at all
cheers
cheers
Sorry, why the C grade on the answer?
ASKER