DOMAssistantAjaxForms - bug

1 view
Skip to first unread message

Cezary

unread,
Jul 7, 2009, 8:58:33 AM7/7/09
to DOMAssistant
Hi.

In this plugin there is a line:

parameters += field.getAttribute("name") + "=" + encodeURIComponent
(((isSelect)? field.options[field.selectedIndex].value : field.value))
+ "&";

but this doesn't working when select type multiple have no selected
options. Then selectedIndex is -1 and code will break at this line. To
fix this I've just done:

if(isSelect && field.selectedIndex != -1){
parameters += field.getAttribute("name") + "=" + encodeURIComponent
(((isSelect)? field.options[field.selectedIndex].value : field.value))
+ "&";
}

Maybe someone fix it in original plugin.

--
Best regards,
Cezary

Mic Cvilic

unread,
Jul 7, 2009, 9:45:19 AM7/7/09
to domass...@googlegroups.com
Hi,

This is not a bug. Just something that may interest you as it is a
rather different behaviour compared to other libs:
dojo, jquery, mootools, prototype, sizzle and sly

DOMAssistant is integrated with the brand new version of PURE (a JS
templating library).

One of the public methods (compile) returns a JS function.
The problem is that DOMAssistant is the only lib that returns an array
and not the function itself.
Do I misuse the DOMAssistant.attach(...) or does the compile method need
to be defined differently?

An example can be seen at http://beebole.com/pure/version2
The DOMAssistant.attach is in the file: pure2.js - line 632
The exception can be seen in the file: index.js - line 162
All thos files can be downloaded as well from
http://github.com/pure/pure/tree/version2

Cheers,
Mic

Reply all
Reply to author
Forward
0 new messages