Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Nov 2009
    Posts
    1
    Vote Rating
    0
    ysolomonrr is on a distinguished road

      0  

    Default [CLOSED][3.??] Ajax Form Submit is not encoding single/multi-select values

    [CLOSED][3.??] Ajax Form Submit is not encoding single/multi-select values


    I have a form with a single select,
    where the display value is "AND" and the internal value is "&&".

    on submitting the form, the single select value is not encoded and hence the encoded string appears as
    Code:
    paramName1=&&&paramName2=someval
    which is resulting in an error in the runtime.

    This section of code in serializeForm method has an issue:
    Code:
    if(/select-(one|multiple)/i.test(type)){                            
                                Ext.each(element.options, function(opt) {
                                    if (opt.selected) {
                                        data += String.format("{0}={1}&",                                                           
                                                             encoder(name),                                                         
                                                              (opt.hasAttribute ? opt.hasAttribute('value') : opt.getAttributeNode('value').specified) ? opt.value : opt.text);
                                    }                                
                                });
    I modified the code locally to address the issue. But is this a known issue or is there any other way to address this apart from fixing the code directly.
    Modified Code:
    Code:
    if(/select-(one|multiple)/i.test(type)){                            
                                Ext.each(element.options, function(opt) {
                                    if (opt.selected) {
                                        data += String.format("{0}={1}&",                                                           
                                                             encoder(name),                                                         
                                                              (opt.hasAttribute ? opt.hasAttribute('value') : opt.getAttributeNode('value').specified) ? encoder(opt.value) : encoder(opt.text));
                                    }                                
                                });
    Last edited by mystix; 24 Nov 2009 at 1:02 AM. Reason: POST CODE IN [code][/code] TAGS. see http://extjs.com/forum/misc.php?do=bbcode#code

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,168
    Vote Rating
    674
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    This is already corrected in SVN, marking as closed.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Thread Participants: 1