EggDesign
New Member
Hi lads
Im doing some work on a site which involves some javascript. Ive got the job half done already. Need help with the second half!
Basically the site has a search by area function here http://www.discoveringcork.ie/places-to-stay/bed-breakfasts/
So when you select an area the results show underneath.
The client wanted me to make it so when you select an area it opens a new page, specific to that area with the results showing (for seo purposes) which i have done on this test page (select bantry)
http://www.discoveringcork.ie/places-to-stay/bed-breakfasts/bandon/
Thats all fine but the results are not showing on the new page.
Here is the form code:
and javascript:
Any help at all with this would be very much appreciated.
cheers
john
Im doing some work on a site which involves some javascript. Ive got the job half done already. Need help with the second half!
Basically the site has a search by area function here http://www.discoveringcork.ie/places-to-stay/bed-breakfasts/
So when you select an area the results show underneath.
The client wanted me to make it so when you select an area it opens a new page, specific to that area with the results showing (for seo purposes) which i have done on this test page (select bantry)
http://www.discoveringcork.ie/places-to-stay/bed-breakfasts/bandon/
Thats all fine but the results are not showing on the new page.
Here is the form code:
Code:
<form name='restaurant_search'>
<select id="location_dropdown" onchange="update_guesthouse_types_new(this.value)">
<?
$myrows = mysql_query( "Select distinct meta_value from wp_postmeta where meta_key='rblocation' order by meta_value asc" );
echo mysql_numrows($myrows);
while ($row = mysql_fetch_array($myrows) ) {
$option_value = strtolower(current(explode(" ", $row[meta_value])));
echo "<option value=\"$option_value\">".$row[meta_value]."</option>";
}
?>
</select>
<input type='button' value='Search »' id='restaurant_search_btn' onclick="update_guesthouse_types();">
</td>
<tr>
</form>
and javascript:
Code:
<script type="text/javascript">
function update_guesthouse_types_new(option){
var base_url = "http://www.discoveringcork.ie/places-to-stay/bed-breakfasts/";
location.href = base_url + option;
}
</script>
Any help at all with this would be very much appreciated.
cheers
john