Topic on Extension talk:Semantic Forms Inputs

jQuery data undefined error and 2 Listbox Appearance

8
117.216.40.47 (talkcontribs)

I installed this extension mainly for the two listboxes but couldnt get it to work properly.

1) In my semantic form, I created a field with input type=two listboxes and when I preview this created form, this is showing this error:

ext.semanticforms.main: TypeError: jQuery(...).data(...) is undefined

The above error shows only when I preview the form in the "CreateForm" page but it seems to work when I actually try to fill-in the form. I am using MW 1.21 and I downloaded the development version of your extension from Git.

2) The listbox display seems different in the picture you had given in your extension page to what I see on my installed version. For example, the 2 listboxes are right next to each other but in your picture it is displayed nicely since the listboxes are separated and displayed with an arrow in between them. How can I get that appearance for these 2 listboxes?

Katkov Yury (talkcontribs)

Hi! I'm the developer of two listboxes, I'll try to help. First please try to add &debug=true to the URL and provide the full error message with problematic line numbers.

Alien Time (talkcontribs)

Thank you Katkov.. Thank you for developing this input method. :)

Okay, I tried adding &debug=true to the URL but nothing happens. Could it be that this error only shows when I click on the "Preview" button when I am Editing the Form and not in the actual URL? For instance, when I add &debug=true directly to the form url like www.url.com/wiki/index.php/Form:xyzForm&debug=true, then it shows the "There is currently no text in this page. You can search for this page title in other pages, search the related logs, or edit this page" message since its trying to create a new page. When I click on Edit Form, and then click preview, that is the time the error shows. So when I try adding &debug=true to the URL that shows when viewing the preview like this: wiki/index.php?title=Form:xyzForm&action=submit&debug=true or wiki/index.php?title=Form:xyzForm&debug=true&action=submit, then it just shows the form edit page without any previews or errors. So sorry couldnt be of help there since I couldnt get the full error message with problematic line numbers. Are you maybe able to reproduce this by trying to edit the form that has the 2 listboxes and then click on Preview button? The error message shows in 2 pop-up boxes when the preview form page is loaded:

Dialog 1 says: "ext.semanticforms.main: TypeError: jQuery(...).data(...) is undefined" with OK button,

Dialog 2 says: "ext.semanticforms.main: TypeError: jQuery(...).data(...) is undefined" along with a checkbox in the next line that says "Prevent this page from creating additional dialogs" and then the OK button.

But like I said before, although these errors shows when I preview the form edit page (note it happens only when I edit the actual form and not the article that was created based on the form), the form actually works when creating an article using it. So not sure what could be the cause...

And, any suggestions on how I can style these listboxes like I mentioned in (2) above? Are the listboxes showing close to each other because of the other error or is this how its supposed to be? Do you have a working example by any chance?

Cheers!

Katkov Yury (talkcontribs)

Can you open it in Chrome and press F12? Pick Console in the tabs and tell what is said there with debug=true.

Alien Time (talkcontribs)

ah...This is what it says:

TypeError: list[firingIndex] is undefined

load.p...131930Z (line 12)


....split(core_rspace),function(_,flag){object[flag]=true;});return object;}jQuery....

And when I click on Line 12, it highlights this:

function doScrollCheck(){if(!jQuery.isReady){try{top.doScroll("left");}catch(e){return setTimeout(doScrollCheck,50);}jQuery.ready();}})();}}}return readyList.promise(obj);};jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(i,name){class2type["[object "+name+"]"]=name.toLowerCase();});rootjQuery=jQuery(document);var optionsCache={};function createOptions(options){var object=optionsCache[options]={};jQuery.each(options.split(core_rspace),function(_,flag){object[flag]=true;});return object;}jQuery.Callbacks=function(options){options=typeof options==="string"?(optionsCache[options]||createOptions(options)):jQuery.extend({},options);var memory,fired,firing,firingStart,firingLength,firingIndex,list=[],stack=!options.once&&[],fire=function(data){memory=options.memory&&data;fired=true;firingIndex=firingStart||0;firingStart=0;firingLength=list.length;firing=true;for(;list&&firingIndex<firingLength;firingIndex++){if(list[firingIndex].apply(data[0],data[1])

Alien Time (talkcontribs)

Another time I reloaded this error showed up too (although most of the time, it shows error in line #12 except for this time):

TypeError: jQuery(...).data(...) is undefined

load.p...3128Z&* (line 32)

...noexecute){var input=this;jQuery(function(){initFunction(input.attr("id"),param)...


Line 32 is this:

initFunction,param,noexecute){if(!this.attr("id"))return this;if(!jQuery("#sfForm").data("SemanticForms")){setupSF();}if(!jQuery("#sfForm").data("SemanticForms").initFunctions[this.attr("id")]){jQuery("#sfForm").data("SemanticForms").initFunctions[this.attr("id")]=new Array();}jQuery("#sfForm").data("SemanticForms").initFunctions[this.attr("id")].push({initFunction:initFunction,parameters:param});if(this.closest(".multipleTemplateStarter").length==0&&!noexecute){var input=this;jQuery(function(){initFunction(input.attr("id"),param)});}return this;};jQuery.fn.SemanticForms_unregisterInputValidation=function(){var sfdata=jQuery("#sfForm").data("SemanticForms");if(this.attr("id")&&sfdata){for(var i=0;i<sfdata.validationFunctions.length;i++){if(typeof sfdata.validationFunctions[i]!=='undefined'&&sfdata.validationFunctions[i].input==this.attr("id")){delete sfdata.validationFunctions[i];}}}return this;};jQuery.fn.SemanticForms_unregisterInputInit=function(){if(this.attr("id")&&jQuery(

Alien Time (talkcontribs)

hi Katkov, hope i am not being impatient by asking for an update on this error? And how do i style the listboxes by increasing its width, etc... i tried the size parameter and the class but cant change its appearance.. sorry, my form is ready to go once i figure this out. :)

Reply to "jQuery data undefined error and 2 Listbox Appearance"