javascript - How to retrieve POST data from TbSelect2 widget in Yiibooster? -


I'm using TBselect2 widget for Yiibooster, code of my thoughts:

  $ This- & gt; Widget ('bootstrap.widgets.TBSelect2', array ('name' = & gt; 'cat_names',' data '= & gt; category :: getRecipe (),' htmlOptions' = & gt; array ('multiple' = ' & Gt; 'multiple', 'class' = & gt; 'span3'))); Render output generates autocomplete input, such as "field", but when I inspect the input field, a similar box appears, it is not an input field but ul list with a div tag with all the selected items.  

After selecting the desired values ​​from the AutoComplete box, I must post the form, but because the HTML input field provided by TBSSET2 is not, how can I get the value generated by the self-fully TBSelect2 widget Can not because it is not a form field?

PS: This is a long form in which there are many HTML elements, so I do not want to submit the form using AJX.

Any help?

If you use the developers tool in a browser, you will see an input box and a selection box Your code should look something like this:

  & lt; Div class = "select2-container" id = "s2id_options" style = "width: 100%;" & Gt; & Lt; A href = "javascript: zero (0)" onclick = "return false;" Class = "select2-choice select2-default" tabindex = "- 1" & gt; & Lt; Span class = "select2-selected" & gt; Choose or start typing a name. & Lt; / Span & gt; & Lt; Abbr class = "select2-search-choice-close" & gt; & Lt; / Abbr & gt; & Lt; span class = "select2-arrow" & gt; & Lt; B & gt; & Lt; / B & gt; & Lt; / Span & gt; & Lt; / A & gt; & Lt; Input class = "select2-focusser select2-offscreen" type = "text" id = "s2id_autogen2" & gt; & Lt; / Div & gt; & Lt; Select name = "cat_names" id = "cat_names" tabindex = "- 1" square = "selection 2-offscreen" & gt; // Your Options & lt; / Select & gt;   

The selected box cat_names will automatically have the correct value on POST, so if you select $ _ POST ['cat_names'] If you see, there should be value in the 2 inputs you selected.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -