jQWidgets Forums

Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts

  • Anywar
    Participant

    Hello Dimitar,
    I can actually submit to the database, and also display values from the databases.
    But am still failing to pick values entered/typed(values that dont exists inside the db.) into the combobox.
    Values selected are coming from a Jason file. and different table.
    So when selected or when a new value is typed, its entered into another table.

    The fact that i can submit selected values…Means the combobox is within a Form element.

    Since i am cascading combos, could the `$(“#emis_no”)<em><strong>.bind</strong>&lt</em>(‘select’, function(event) be the one causing this unusual behaviour..?
    `


    Anywar
    Participant

    Hello Dimitar,
    I ended up combining the two as seen in the code below;
    But still no change or effect to the issue.

    <script type="text/javascript">
    $(document).ready(function () {
    		//start EMIS code
    			var customersSourcel =
    		{
    			datatype: "json",
    			datafields: [
    				{ name: 'Emis_No'},
    				{ name: 'District'},
    				{ name: 'County'},
    				{ name: 'Subcounty'},
    				{ name: 'Parish'},
    				{ name: 'School'}
    			],
    			url: 'includes/emis.php',
    			cache: false,
                async: false
    		};
    		// Create a jqxComboBox
    		var customersAdapterl = new $.jqx.dataAdapter(customersSourcel);
    
    		$("#emis_no").jqxComboBox(
    		{
    			source: customersAdapterl,
    			
    			width: 200,
    			height: 25,
    			promptText: "emis",
    			displayMember: 'Emis_No',
    			valueMember: 'Emis_No'
    		});
    		
    		$("#emis_no").bind('select', function(event) 
    		{
    			if (event.args)
    			{
    				var index = $("#emis_no").jqxComboBox('selectedIndex');		
    				if (index != -1)
    				{
    					var record = customersAdapterl.records[index];
    					document.form1.district.value = record.District;
    					$("#county").jqxComboBox({ disabled: false});
    					document.form1.county.value = record.County;
    					$("#sub_county").jqxComboBox({ disabled: false});
    					document.form1.sub_county.value = record.Subcounty;
    					$("#parish").jqxComboBox({ disabled: false});
    					document.form1.parish.value = record.Parish;
    					$("#school").jqxComboBox({ disabled: false});
    					document.form1.school.value = record.School;
    				}
    			}
    		});    
    
    	        $("#emis_no input").on('keypress', function(event) 
    		{
                     var enteredValue = $("#emis_no input")[0].value;
    
                    if (event.key === 'Enter') 
    		{
                     var existingItem = $("#emis_no").jqxComboBox('getItemByValue', enteredValue);
                     if (existingItem === undefined)
    		 {
                     $("#emis_no").jqxComboBox('addItem', enteredValue);
                     var item = $("#emis_no").jqxComboBox('getItemByValue', enteredValue);
                     $("#emis_no").jqxComboBox('selectItem', item);
                      }
                        }
                     });
    
    		
    		//END EMIS CODE

    Anywar
    Participant

    I also tried renaming the from (“#emis_no Input”) to just (“#emis_no”) but still values not being captured.


    Anywar
    Participant

    This is what I have done basing on that example, and still it is not being picked by php.(I mean the typed values.

    $(document).ready(function () {
    		//start EMIS code
    			var customersSourcel =
    		{
    			datatype: "json",
    			datafields: [
    				{ name: 'Emis_No'},
    				{ name: 'District'},
    				{ name: 'County'},
    				{ name: 'Subcounty'},
    				{ name: 'Parish'},
    				{ name: 'School'}
    			],
    			url: 'includes/emis.php',
    			cache: false,
                async: false
    		};
    		
    		var customersAdapterl = new $.jqx.dataAdapter(customersSourcel);
    
    		$("#emis_no").jqxComboBox(
    		{
    			source: customersAdapterl,
    			
    			width: 200,
    			height: 25,
    			promptText: "emis",
    			displayMember: 'Emis_No',
    			valueMember: 'Emis_No'
    		});
    		
    		 $("#emis_no input").on('keypress', function(event) {
                     var enteredValue = $("#emis_no input")[0].value;
                    if (event.key === 'Enter') {
                     var existingItem = $("#emis_no").jqxComboBox('getItemByValue', enteredValue);
                     if (existingItem === undefined) {
                     $("#emis_no").jqxComboBox('addItem', enteredValue);
                     var item = $("#emis_no").jqxComboBox('getItemByValue', enteredValue);
                     $("#emis_no").jqxComboBox('selectItem', item);
                      }
                        }
                     });
    
    		
    		//END EMIS CODE

    Anywar
    Participant

    Hello Dimitar,
    Thanks..for this..
    But then..the scenario is that I have a jason file pulling data from mysql database table A.
    Then the data is selected and displayed on the combobox.
    However there are some I also want to add a new values, so I have to type the value into the combobox.
    So how do I get either typed value or selected value picked by php and either echoed or submitted to the database.

    Thank you for your help.


    Anywar
    Participant

    I am still having similar problem now.
    WHen I edit a value from withing the combobox or type another value into the combobox, the value is not read or submitted.

    Somebody with the solution please help me.
    I have tried chnaging the methods, but nothing is happening.


    Anywar
    Participant

    Hello, I can submit selected. My problem is It cannot submit Typed values.

    I can pick values from the database. and select them and then submit.

    For example, if a value from the database is misspelt, and i need to edit it..The edited value is not submit where it should go.

    Please help.


    Anywar
    Participant

    I tried to initialise customers as seen below, but still nothing..instead its just showing now the last record in the database, and when I type, still, the value is not picked/ echoed. Somebody please help.
    Thank you
    $customers =array();
    $customers[] = array( ‘Emis_No’ => $row[‘Emis_No’], ‘District’ => $row[‘District’], ‘County’ => $row[‘County’], ‘Subcounty’ => $row[‘Subcounty’], ‘Parish’ => $row[‘Parish’], ‘School’ => $row[‘School’] );

Viewing 8 posts - 1 through 8 (of 8 total)