Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Doug on Jan 28, 2009 20:25
open dhtmlx forum
dhtmlXComboFromSelect and Firefox

I'm having trouble getting the values from the dhtmlXComboFromSelect in Firefox. If I use A, firefox does not post the values from the select like its supposed to, but IE does. If I use B, firefox posts the values, but IE comes up with a javascript error, 'Invalid argument'

A: var za00=new dhtmlXComboFromSelect('combo_zone00');
B: var za00=new dhtmlXComboFromSelect('combo_zone00', 'insp_code00');


<select name='insp_code00' style='width:70px; background-color:#ffdddd; display:inline;' name='insp_code00' id='combo_zone00' onChange='updateScore("0");' ><option value=''></option><option value='100'>100</option><option value='A' selected >A</option><option value='B'>B</option><option value='C'>C</option><option value='D'>D</option><option value='E'>E</option><option value='F'>F</option><option value='G'>G</option><option value='H'>H</option><option value='I'>I</option><option value='J'>J</option><option value='K'>K</option><option value='L'>L</option><option value='M'>M</option><option value='N'>N</option><option value='O'>O</option><option value='P'>P</option><option value='Q'>Q</option><option value='R'>R</option><option value='S'>S</option><option value='T'>T</option><option value='U'>U</option><option value='V'>V</option><option value='W'>W</option><option value='X'>X</option><option value='UA'>UA</option><option value='UB'>UB</option><option value='UC'>UC</option><option value='UD'>UD</option><option value='PA'>PA</option><option value='PB'>PB</option><option value='PC'>PC</option><option value='PD'>PD</option><option value='PE'>PE</option><option value='PF'>PF</option><option value='PG'>PG</option><option value='PH'>PH</option><option value='DA'>DA</option><option value='DB'>DB</option><option value='DC'>DC</option><option value='DD'>DD</option><option value='DE'>DE</option><option value='DF'>DF</option><option value='DG'>DG</option></select></span></td>

var za00=new dhtmlXComboFromSelect('combo_zone00');
// var za00=new dhtmlXComboFromSelect('combo_zone00', 'insp_code00');
za00.DOMelem_input.style.backgroundColor ='#ffdddd';
za00.enableFilteringMode(true);
Answer posted by Support on Jan 29, 2009 05:44
The correct code is 
  var za00= dhtmlXComboFromSelect('combo_zone00'); //new is not necessary
but it is not critical.
The second parameter can be used to specify size, the name of input element always taken from source select box. 

Please check attached sample

Attachments (1)
Answer posted on Jan 29, 2009 21:58
I've made the updates per the sample not use "new".  Also I found I had name twice in my select so I fixed that two.  But I'm still not getting the value when posting from Firefox.  Could there be something else interfering?  The second parameter thing doesn't work as it really is the style attribute as stated.  I'm at a loss.  Something must be interfering.  I attached page source.  It does work like its supposed to in IE.  I'm just not getting the attributes posted from Firefox.
Attachments (1)
Answer posted by Support on Jan 30, 2009 01:21
The sample which you have attached to the previous post doesn't contain the code mentioned earlier ( it doesn't contain any combo initialization code ) , but I was able to reconstruct the problem.
You have form tag placed between table and tr tags which is not valid position and may affect data sending, if the same actual for the original page - just move form tag before <table> tag ( and closing form tag after closing </table> tag ) - it will resolve issue with data sending. 
Answer posted on Jan 30, 2009 11:24
Thank you.  Not sure how long that would have taken me. If ever.  IE is probably to forgiving and allows http://dhtmlx.com/docs/products/kb/imgs/_button_post_answer.gif">sloppiness.  Thanks a bunch!!!