<label for="location"><?php _e('Location','cp'); ?> <span>*</span> <span style="display:none;" class='ajax_errors' id='location_errors'></span></label> <input type="text" id="location" class="adfields" name="location" size="50" maxlength="100" value="<?php echo $location; ?>" />
<label for="location"><?php _e('Location','cp'); ?> <span>*</span> missing your location? suggest it! <span style="display:none;" class='ajax_errors' id='location_errors'></span></label> <select name="country" onchange="htmlData('<? bloginfo('template_directory'); ?>/city.php', 'ch='+this.value)" /> <option value="#">- Select Area -</option> <option value="Melbourne City">Melbourne City</option> <option value="Surrounding Areas">Surrounding Areas</option> <option value="Other Victoria">Other Victoria</option> </select> <div id="txtResult"> <select name="location"><option></option></select> </div>
<?php ini_set('display_errors', 1); error_reporting(E_ALL); // List of cities for melb city if ($_GET['ch'] == 'Melbourne City') { ?> <select name="location"> <option value="Altona, victoria">Altona</option> <option value="Ascot Vale, victoria">Ascot Vale</option> <option value="Carlton, victoria">Carlton</option> <option value="Central Business District, Melbourne">Central Business District</option> <option value="Clifton Hills, victoria">Clifton Hills</option> <option value="Collingwood, victoria">Collingwood</option> <option value="Docklands, victoria">Docklands</option> <option value="East Melbourne, victoria">East Melbourne</option> <option value="Essendon, victoria">Essendon</option> <option value="Fitzroy, victoria">Fitzroy</option> <option value="Middle Park, victoria">Middle Park</option> <option value="North Carlton, victoria">North Carlton</option> <option value="North Fitzroy, victoria">North Fitzroy</option> <option value="North Melbourne, victoria">North Melbourne</option> <option value="North Melbourne, victoria">Parkville</option> <option value="Port Melbourne, victoria">Port Melbourne</option> <option value="Prahran, victoria">Prahran</option> <option value="Prahran, victoria">Richmond</option> <option value="South Melbourne, victoria">South Melbourne</option> <option value="South Yarra, victoria">South Yarra</option> <option value="Southbank, victoria">Southbank</option> <option value="St. Kilda, victoria">St. Kilda</option> <option value="St. Kilda Road, victoria">St. Kilda Road</option> <option value="St. Albans, victoria">St. Albans</option> <option value="Sunshine, victoria">Sunshine</option> <option value="Sydenham, victoria">Sydenham</option> <option value="West Melbourne, victoria">West Melbourne</option> <option value="Williamstown, victoria">Williamstown</option> </select> <?php } // List of cities for Surrounding Areas if ($_GET['ch'] == 'Surrounding Areas') { ?> <select name="location"> <option value="Bacchus Marsh, victoria">Bacchus Marsh</option> <option value="Geelong, victoria">Geelong</option> <option value="Melton, victoria">Melton</option> <option value="Outer East, victoria, Australia">Outer East</option> <option value="Outer North, victoria, Australia">Outer North</option> <option value="Outer Northeast, victoria, Australia">Outer Northeast</option> <option value="Outer Southeast, victoria, Australia">Outer Southeast</option> <option value="Sunbury, victoria">Sunbury</option> </select> <?php } // List of cities for Other Victoria if ($_GET['ch'] == 'Other Victoria') { ?> <select name="location"> <option value="Albury, victoria">Albury/Wodonga</option> <option value="Ballarat, victoria">Ballarat</option> <option value="Bendigo, victoria">Bendigo</option> <option value="Dandenong Ranges, victoria">Dandenong Ranges</option> <option value="Daylesford, victoria">Daylesford</option> <option value="Gippsland, victoria">Gippsland</option> <option value="Goldfields, victoria">Goldfields</option> <option value="Grampians, victoria">Grampians</option> <option value="Great Ocean Road, victoria">Great Ocean Road</option> <option value="Mildura, victoria">Mildura</option> <option value="Phillip Island, victoria">Phillip Island</option> <option value="Shepparton, victoria">Shepperton Area/The Murry</option> <option value="Swan Hill, victoria">Swan Hill</option> <option value="Warrnambool, victoria">Warrnambool</option> <option value="Yarra Valley, victoria">Yarra Valley</option> </select> <?php } ?>
// select box function GetXmlHttpObject(handler) { var objXMLHttp=null if (window.XMLHttpRequest) { objXMLHttp=new XMLHttpRequest() } else if (window.ActiveXObject) { objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") } return objXMLHttp } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("txtResult").innerHTML= xmlHttp.responseText; } else { //alert(xmlHttp.status); } } // Will populate data based on input function htmlData(url, qStr) { if (url.length==0) { document.getElementById("txtResult").innerHTML=""; return; } xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request"); return; } url=url+"?"+qStr; url=url+"&sid="+Math.random(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true) ; xmlHttp.send(null); }
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/list.js"></script>
<label for="location"><?php _e('Location','cp'); ?> <span>*</span></label> <input type="text" id="location" class="adfields" name="location" size="60" maxlength="100" value="<?php echo $_POST['location']; ?>" />
<label for="location"><?php _e('Location','cp'); ?> <span>*</span> missing your location? suggest it! <span style="display:none;" class='ajax_errors' id='location_errors'></span></label> <select name="country" onchange="htmlData('<? bloginfo('template_directory'); ?>/city.php', 'ch='+this.value)" /> <option value="#">- Select Area -</option> <option value="Melbourne City">Melbourne City</option> <option value="Surrounding Areas">Surrounding Areas</option> <option value="Other Victoria">Other Victoria</option> </select> <div id="txtResult"> <select name="location"><option></option></select> </div>
There are currently 1 users browsing this thread. (0 members and 1 guests)