I have the form submission because it is a simple
onchange="submit();"
<div class="cities">Select City <form method="post" action="<?php echo $PHP_SELF;?>" style="float:right;"><select name="city_select" id="city_select" onchange="submit();"><option>-----</option>
<option value="Beijing" <?php if($_SESSION['city_selected'] == 'Beijing') { echo 'selected=selected';} else { echo ''; }?> >Beijing</option>
<option value="Shanghai" <?php if($_SESSION['city_selected'] == 'Shanghai') { echo 'selected=selected';} else { echo ''; }?> >Shanghai</option>
<option value="Guangzhou" <?php if($_SESSION['city_selected'] == 'Guangzhou') { echo 'selected=selected';} else { echo ''; }?> >Guangzhou</option>
<option value="Manila" <?php if($_SESSION['city_selected'] == 'Manila') { echo 'selected=selected';} else { echo ''; }?> >Manila</option>
<option value="HongKong" <?php if($_SESSION['city_selected'] == 'HongKong') { echo 'selected=selected';} else { echo ''; }?> >Hong Kong</option>
<option value="Tokyo" <?php if($_SESSION['city_selected'] == 'Tokyo') { echo 'selected=selected';} else { echo ''; }?> >Tokyo</option>
<option value="Seoul" <?php if($_SESSION['city_selected'] == 'Seoul') { echo 'selected=selected';} else { echo ''; }?> >Seoul</option>
<option value="Taipai" <?php if($_SESSION['city_selected'] == 'Taipai') { echo 'selected=selected';} else { echo ''; }?> >Taipai</option>
</select></form>
<div style="clear:both;"></div>
</div>
I’m trying to submit the form and also redirect to a url. I was wondering if this was possible. I’ve tried implementing a jquery $.change event but it didn’t fire before the form submit()
if anyone could help, that would be fantastic. Thanks!
Just do it in php by:
header('Location: ' . the_url_to_redirect);