combox does not always return altered value.

I have a combobox which fetches the username from a mysql table, when i type a characte, it pulls all the names starting with that character, so far so good. The actual problem is when value in the combobox is not from the database, manually altered value,

then sometimes the value is not captured in the POST method, however the “COMBO_new_value” is captured properly.

please help.



Most probably focus wasn’t moved out from the combo, before sending the request to the server side.
You can try to add the next line to the combo’s init
combo.attachEvent(“onSelectionChange”,combo._confirmSelection);


Hi,



Thanks for responding so quickly. I still have the same issue.  I dont think its a focus issue. I am not sure really. Heres the part of the code.




  
  
   

  …more html data



and in add.php if i print $_POST, this is wht i get



Array ( [other] => [other_new_value] => true [button1] => Add )



 This is happening only for altered values, some time it captures, sometimes it doesnt, and  for values returned from the mysql table, they are captured properly.



 

Others:
     

 

     <input type=“submit” name=“button1” id=“button1” value=" Add " class=“input”  style=“height:21px; width:40px; cursor:hand; text-align:center; border-style:outset; border:thin; color:#000000; font-size:10px; " title=”"/>



Problem can’t be reconstructed locally. Both values changed in the same place of code - so it doesn’t look possible to have them desynced.
Are you using any other combo events?
You can try to add one more change.
<form id=“form10” onsubmit=“z1.confirmSelection()”

If issue still occurs - please provide any kind of sample of demo link where issue can be reconstructed



Hi,



This is very easily reproduceable, I have checked with 3 more PC’s and this happens in all the machines.



Following are code where the problem can be seen.



Test.html 




 
     


 

     <input type=“submit” name=“button1” id=“button1” value=" Add " class=“input”  style=“height:21px; width:40px; cursor:hand; text-align:center; border-style:outset;  border:thin; color:#000000; font-size:10px; " title=”"/>
    





addAttendeesToTempTable.php



<?php



print_r($_POST) ?>



Results:



Array ( [other] => [other_new_value] => true [button1] => Add )



Not all the time, the POST[‘other’] is blank, sometimes it does captures values.



 


I cant provide a link, because this is within an intranet network, but the code above will reproduce it,



1. Manually type some values in the combo box and click add, and check in the server if its captured.



2. if yes, go back, refresh page, and do step one.



The issue will happen b/w 1 and 2. certain.


One more thing i notice now is , and i believe this will help support,



1. I type K, and the drop down is filled with list of names starting with K, and I chose ‘Kris’,



2. Edit this entry in the combobox by appended ’ A’ at the end, so the final value in the combo looks like ‘Kris A’



3. Submit this and i see that the captured value is ‘Kris’ and NOT ‘Kris A’



 


Further, when i remove z1.enableFilteringMode(true,“complete.php”,true); from the code, and enter values into the combobox, they are properly



captured in the server, just like a normal html . The problem only occurs when i include the complete.php file in the filtering mode. its an erractic behavior like i said.  so that leads me to believe if there is a problem in the complete.php file, because i altered it to fit my needs. I have attached the file for your reference.



Finally , I aplogize for submitting several posts , we have an intranet app coming up and i need this combo box, and after seeing what DHTMLX can do, i am thrilled. Kindly help us fix this.



Best,



Kris A


complete.php.zip (693 Bytes)

Hi Kris

The issue still can not be reproduced… The php file which you are provided looks correct. I have attached the sample.

combo_save.zip (21 KB)


Hi ,



I am not sure why u guys are unable to reproduce it, however could it be because i am using 2 combobox in a single page. Could it be somethin to do with some initialization?? , my first combo looks like



   


     

   

 



second combobox looks like:



    Others:



 

 
     <input type=“submit” name=“button1” id=“button1” value=" Add " class=“input”  style=“height:21px; width:40px; cursor:hand; text-align:center; border-style:outset; border:thin; color:#000000; font-size:10px; " title=”"/>



However I have found a solution, and untill you guys get more data on this, this solution might help somebody else.



1. The complete.php has $_GET[‘mask’], this contains the value currently in the combobox. whether from the db or altered, that value resides in $_POST[‘mask’];



2. Write this value into a file/session.



3. In the collecting server page, just check if $_POST[‘whatever is the value of the combo box’] is blank (" "), if it is,  read from the session/file(file_get_contents) else, read from the combo box. All altered values are captured in the $_POST[‘mask’] so your file will have the altered entry. just make sure the file gets rewritten everytime.(“w+” mode).



 






Unfortunately we still not able to reconstruct issue locally, the sample attached to previous email, uses the same init but works correctly.
We will check the possible reasons, but sor far it works correctly in the same scenario in local tests


Thats ok, atleast if another occurence of this happens, you guys will atleast have some data. For now, i am happy with the solution and the combobox, its fantastic.



However I just have to say that, in my experience i have encountered only a very few support teams whose response is as quick as yours. very commendable.  Keep up the good work.

Hi

I was having similar problems. And it was hard to reproduce.

Here is what I first did:



… other stuff in the form





I managed to get the alert when I put it on a remote server, typed fast, and clicked the submit button quickly after typing some text in the combo. My guess is, it was accessing complete.php while the form was submitted.

So I changed the verify function to this:

function verify(f) {
z1.setComboValue(z1.getComboText());
return true;
}

It seems it solved the problem.