I know this seems like silly, maybe some experts can help me on this:
I have 2 CFSELECT boxes.
I'm populating a 2nd CFSELECT from database based on the value (KOD_DAERAH) passed from the first CFSELECT. My code are:
<cfselect name="cmbKodDaerah" query="GetDaerah" value="KOD_DAERAH" selected="#KOD_DAERAH#" display="Daerah" onChange="update_dataN(frmProjek, #ID#);"></cfselect>
<CFSELECT name="cmbKodMukim" query="GetMukim" value="KOD_MUKIM" display="Mukim" ></CFSELECT>
These are my queries:
<cfquery name="GetDaerah" datasource="Keda" dbtype="ODBC">
Select * from Kod_Daerah
</cfquery>
<cfquery name="GetMukim" datasource="Keda" dbtype="ODBC">
Select * from Kod_Mukim where KOD_MUKIM like '#KOD_DAERAH#%'
</cfquery>
My problem is, i still need the area code (KOD_DAERAH) values to populate the 2nd CFSELECT but when it comes to saving data, i want to capture the text showed in the cfselect box, NOT the value. Is there any variable like #form.cmbKodDaerah.text#? I've tried this but failed. Any ideas?
I have 2 CFSELECT boxes.
I'm populating a 2nd CFSELECT from database based on the value (KOD_DAERAH) passed from the first CFSELECT. My code are:
<cfselect name="cmbKodDaerah" query="GetDaerah" value="KOD_DAERAH" selected="#KOD_DAERAH#" display="Daerah" onChange="update_dataN(frmProjek, #ID#);"></cfselect>
<CFSELECT name="cmbKodMukim" query="GetMukim" value="KOD_MUKIM" display="Mukim" ></CFSELECT>
These are my queries:
<cfquery name="GetDaerah" datasource="Keda" dbtype="ODBC">
Select * from Kod_Daerah
</cfquery>
<cfquery name="GetMukim" datasource="Keda" dbtype="ODBC">
Select * from Kod_Mukim where KOD_MUKIM like '#KOD_DAERAH#%'
</cfquery>
My problem is, i still need the area code (KOD_DAERAH) values to populate the 2nd CFSELECT but when it comes to saving data, i want to capture the text showed in the cfselect box, NOT the value. Is there any variable like #form.cmbKodDaerah.text#? I've tried this but failed. Any ideas?