I'm working on this form select condition that will load a specific page when the submit button is clicked. Right now i'm getting a Unexpected Token error for windows.location
. All files are in the same folder
<script>
$(document).ready(function() {
$("#process_app").submit(function() {
var selrange = $("select#range").val();
var selplace = $("select#place").val();
var selindustry = $("select#industry").val();
if (selrange = '1') {
// if value 1 load US short app, if value 2 load Canada short app
window.location = selplace = "1" ? 'application_us_short.php' : 'application_ca_short.php');
}
if ((selrange = '2') && (selindustry = '2' || selindustry = '10')) {
window.location = selplace = "1" ? 'application_us_short.php' : 'application_ca_short.php');
}
if ((selrange = '2') && (selindustry != '2' || selindustry != '10') || selrange = '3') {
window.location = selplace = "1" ? 'application_us.php' : 'application_ca.php');
}
});
});
</script>
<div style="margin: 0 auto; text-align: center; margin-top: 60px">
<form id="app_type">
<h4>What country are you located in?</h4>
<select id="place" name="place" onchange="location = this.options[this.selectedIndex].value;">
<option value="1">United States</option>
<option value="2">Canada</option>
</select>
<h4>What industry is your company most closely associated with?</h4>
<select id="industry" name="industry" onchange="location = this.options[this.selectedIndex].value;">
<option value="1">Agriculture</option>
<option value="2">Consumer Electronics & Appliances</option>
<option value="3">Construction/Industrial</option>
<option value="4">Manufactured Housing</option>
<option value="5">Marine</option>
<option value="6">Music</option>
<option value="7">Outdoor Power Equipment</option>
<option value="8">Power Sports</option>
<option value="9">Recreational Vehicles</option>
<option value="10">Technology</option>
<option value="11">Trailer</option>
</select>
<h4>What credit line range are you applying for?</h4>
<select id="range" name="range" onchange="location = this.options[this.selectedIndex].value;">
<option value="1">Less than $150,000</option>
<option value="2">$150,001-$350,000</option>
<option value="3">$350,000+</option>
</select>
<hr>
<input type="submit" value="Submit" id="process_app" />
</form>
</div>