We have a new website developed by a outside company that we are having issues with. I am trying to figure out the logic on a piece of code that would pull up a new page if some requirements are met.
First of all this is the site http://www.winstonind.com/service
For any servicer in the US it pulls up a Google map and the locations of our servicers for any other options in the drop-down it doesn’t do anything. what I would like to know is how I would make is so if china is selected it would go to a page I created with the list of servicers from that region can you help me with this? I don’t understand alot of Javascript yet and I cant tinker alot since the site is live.
<script type="text/javascript">
$("#country").change(function(){
$(this).val()!='default'?$("#state").hide():$("#state").show();
});
var typeChoice;
$("#step1next").click(function(){
typeChoice = $(".mt:checked").val();
$(".step.1").removeClass('selected');
$(".step.2").addClass('selected');
$(".step.1 .sContent").slideUp();
$(".step.2 .sContent").slideDown();
});
$("#step2next").click(function(){
if(typeChoice == 'type1')
{
$("#mapResult").html('<p style="text-align:center; margin-bottom:5px;">For all service requests that are in-warranty please contact Winston Industries directly.</p><p style="text-align:center;">Toll free: 1-800-234-5286<br/>International: +1-502-495-5400</p>');
}else{
$("#mapResult").html('');
var zip='';
$("#state").val()==$("#state").attr('default')?zip='':zip=$("#state").val();
//to make distance dynamic, replace 50 with a dynamic value
$.post('service/getMap/'+zip+'/50',function(data){
$("#mapResult").html(data);
});
}
$(".step.2").removeClass('selected');
$(".step.3").addClass('selected');
$(".step.2 .sContent").slideUp();
$(".step.3 .sContent").slideDown();
});
$(".sContent").hide();
$(".selected .sContent").show();
</script>
Add the following before your closing and modify the url to point to the correct directory and url.
This is what your select box code looks like:
You will notice that the “id” in the first line is called country. so we want to read the value that the user has placed in the select box of country which could be canada, china, USA, etc…