Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Dec 04, 2009 05:29
open dhtmlx forum
Want to fire event on onchange event and want to get that passed id

Hi,

I am using one combobox above the table, and I want that the div will get load after changing the id of that combobox.
I want to pass my project Id from that combobox and want to fetch to the record according the selected project. So, that the data of that div should get fill of that particular project.

This is my html page which shows the dropdown.


<script>



window.dhx_globalImgPath = "http://localhost/seema/combo_test/codebase/imgs/combo_select.gif";



</script>

<link rel="STYLESHEET" type="text/css" href="codebase/dhtmlxcombo.css">

<script src="codebase/dhtmlxcommon.js"></script>

<script src="codebase/dhtmlxcombo.js"></script>

<script src="codebase/ext/dhtmlxcombo_extra.js"></script>











<h3>Checkbox Select</h3>

<div id="combo_zone2" style="width:200px; height:30px;" onclick="add();"></div>

<h3>Checkbox Select</h3>

<div id="combo_zone3" style="width:200px; height:30px;"></div>

<script>



var z = new dhtmlXCombo("combo_zone2", "alfa2", 200, 'checkbox');

z.loadXML("common/test.php");

var z = new dhtmlXCombo("combo_zone3", "alfa3", 200, 'checkbox');

z.addOption([[1, 1111], [2, 2222], [3, 3333], [4, 4444], [5, 5555]]);



</script>



<script language="javascript">

function add()

{

    alert("seema");

    var chk=document.getElementById('testchk[]').checked;

    var chk1 = chk.length;

    alert(chk1);

    

    

}

</script>




I want to show to data of selected project inbetween the div given below.
<div id="projId"'></div>

Please reply me as soon as possible

Thanks
Suraj
Answer posted by Alex (support) on Dec 04, 2009 05:43

Combo has onChange event. It occurs when new option is selected:

combo.attachEvent("onChange",function(){

    var selected_value = combo.getActualValue();

    /*your code here*/

})