<form method="POST" id="formAjaxDefault">
<select name="gudang">
	<option value="">PILIH GUDANG
	<?php foreach($this->data->cabang as $r){ ?>
		<option value="<?php echo $r->kd_gudang ?>"><?php echo $r->kd_gudang.' - '.$r->nm_gudang ?>
	<?php } ?>
</select>
<select name="lok">
	<option value="">LOKASI
	<?php 
	$kode = new Kode;
	foreach($kode->ConfAbjNum() as $r){ 
	?>
		<option value="<?php echo $r ?>">LOKASI <?php echo $r ?>
	<?php } ?>
</select>
<input type="submit" value="PILIH" id="_simpan">
</form>
		<div id="errorDisplay"></div>

<script type="text/javascript">
$(document).ready(function(){

	_makeLoadDetMut = false;
	$('#formAjaxDefault').submit(function(e){
		e.preventDefault();
		_conf = confirm("Pilih Gudang?");
		if(_conf){
			$('#_loadingSimpan').html('Proses...');
			if(_makeLoadDetMut != false){
				_makeLoadDetMut.abort();
			}

			_makeLoadDetMut = $.ajax({
			type: 'POST',
				url: '<?php echo $this->baseUrl; ?>sopcb/pilih_gudang/',
				data: $('#formAjaxDefault').serialize(),
				success: function(data) {
					$('#_loadingSimpan').html('www.rasio.id');
					$('#errorDisplay').html(data);
				}
			})
		}
	})
})	
</script>
