Combo box tidak muncul

Robert James M · Oct 27, 2012
mas sesuai http://www.myphptutorials.com/questions/combo-box-tidak-muncul_865.html, aku buat perubahan untuk penyesuaian form, nah ini jsnya
<?php
 
	mysql_connect	('localhost','root','rahasia');
	mysql_select_db	('abms');
 
	if ($_SERVER['REQUEST_METHOD'] == 'POST') {
		$tipedata	= $_POST['tipe'];
		$id			= $_POST['id'];
 
		switch($tipedata){
					
			case 'unit':
				$sql='SELECT kode_unit,nama_unit,produk FROM '.$tipedata.' WHERE kodeP = "'.$id'" ORDER BY nama_unit ASC';break;
			case 'produk':
				$sql='SELECT kodeP,produk FROM '.$tipedata.' ORDER BY produk ASC';break;
		}
 
		$kueri=mysql_query($sql);
		echo '<option value=""></option>';
		while($row=mysql_fetch_object($kueri)){
			echo '<option value="'.$row->kodeP.'">';
			switch($tipedata){
			case 'unit':
				echo $row->nama_unit;break;
			case 'produk':
				echo $row->produk;break;
			}
			echo '</option>';
		}
	}
?>

dan ini formnya
<script language="javascript">
function Load(data,primid){
	$('#loading'+data).empty().append('<img src="img/ajax-loader.gif"/>');
	$.post("js_unit.php",{tipe:data,id:primid},
	function(result){
		$('#cb'+data).html(result);
		$('#loading'+data).empty();
	}
	);
}
$(function(){
	Load('produk',0);
 
	$('#cbproduk').change(
		function(){			
			if($('#cbproduk option:selected').val() !=''){
				Load('unit',$('#cbproduk option:selected').val());
			}
		}
	);
 
});
</script>  


<tr title="Required">

                        <td><b>Produk</b><span class="required">*</span></td>

                        <td>:</td>

                        <td><select name="produk" id="cbproduk" style="width:311px"></select></td>
					</tr>
					
					<tr title="Required">

                        <td><b>Unit</b><span class="required">*</span></td>
                        <td>:</td>
						<td><select name="nama_unit" id="cbunit" style="width:311px"></select></td>   
                    </tr>
Silahkan login untuk menjawab!
0
Loading...
Robert James M · Oct 27, 2012 · 0 Suka · 0 Tidak Suka
tapi seperti biasa ga muncul di formnya, kenapa ya?

untuk databasenya

unit

kode_unit
nama_unit
produk
kodeP

produk
kodeP
produk
-1
Loading...
Ellyx Christian · Oct 28, 2012 · 0 Suka · 1 Tidak Suka
sepertinya tidak ada yang salah, coba pake firebug untuk cari salahnya dimana.
0
Loading...
Robert James M · Oct 29, 2012 · 0 Suka · 0 Tidak Suka
sepertinya muncul error seperti ini

ReferenceError: reference to undefined property this._leftDiv
[Break On This Error]

Filtered chrome url chrome://browser/content/orion.js

orion.js (line 9326)

ReferenceError: reference to undefined property a.target.nodeType
[Break On This Error]

...!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toEle...

jquery....min.js (line 56)

ReferenceError: reference to undefined property a
[Break On This Error]

...e if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a=d;return typeof b==="string"?a[b...

jquery....min.js (line 38)

ReferenceError: reference to undefined property d[0]
[Break On This Error]

...{a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;...

jquery....min.js (line 41)

ReferenceError: reference to undefined property a[++e]
[Break On This Error]

...rn(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==n...

jquery....min.js (line 30)

ReferenceError: reference to undefined property a.result
[Break On This Error]

...ntDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}re...

jquery....min.js (line 55)

ReferenceError: reference to undefined property this.context.breakOnNextMutate
[Break On This Error]

Filtered chrome url chrome://firebug/content/html/htmlPanel.js

htmlPanel.js (line 1790)
<System>

ReferenceError: reference to undefined property this.persistContent
[Break On This Error]

Filtered chrome url chrome://firebug/content/console/consolePanel.js

consolePanel.js (line 147)
<System>

ReferenceError: reference to undefined property elementArr.nodeType
[Break On This Error]

Filtered chrome url chrome://firebug/content/html/inspector.js

inspector.js (line 82)
<System>

ReferenceError: reference to undefined property context.sourceFileMap[url]
[Break On This Error]

Filtered chrome url chrome://firebug/content/js/sourceFile.js

sourceFile.js (line 1017)
<System>

XUL box for _moz_generated_content_before element contained an inline #text child, forcing all its children to be wrapped in a block.

ReferenceError: reference to undefined property this.tabMap[panelName]
[Break On This Error]

Filtered chrome url chrome://firebug/content/firefox/bindings.xml

bindings.xml (line 84)
<System>

ReferenceError: reference to undefined property this.tabLinks[tabID]
[Break On This Error]

Filtered chrome url chrome://idabar/content/idabar.js

idabar.js (line 130)

ReferenceError: reference to undefined property this.tools[name]
[Break On This Error]

Filtered chrome url chrome://firebug/content/bti/inProcess/browser.js

browser.js (line 318)
<System>[/url]
-1
Loading...
Ellyx Christian · Oct 30, 2012 · 0 Suka · 1 Tidak Suka
error itu tidak membantu, errornya karena kode javascript atau kode phpnya tidak terlihat.
0
Loading...
Robert James M · Oct 30, 2012 · 0 Suka · 0 Tidak Suka
makanya mas, itu js dan bukan masalah kenapa tidak muncul...