I have to deal with some old Javascript code that is throwing an error at addOption and selectOptions
Error: Object has no method selectOptions
Can someone explain me why is it not working? I am using jQuery 1.3
$("some_id").addOption(nodeId, nodeName); // add to list
$("some_id").selectOptions(/^~~/i, true); // clear selection
I solved the addOption line by this
$("some_id")[0].options.add( new Option(nodeName,nodeId));
but I'm still stuck with selectOptions error.
UPDATE just found out the application is also using Dojo. Could that be the problem? Are these methods Dojo specific?
Thanks!
use Jquery Append to add options like this
try this, you can write your own methods:
working fiddle here: http://jsfiddle.net/maverickosama92/rGzPS/1/
Finally found whats wrong with it. These methods come from a jquery plugin by TexoTela. Why would someone do that just for select boxes?? Beats me