javascript - Get data from unordered lists that are dynamically added to the page -
i'm having page can create configuration sections , page structured follows: has button adds partial view page (using ajax call) , on partial view have:
- dropdown select section
- list of available items
- list of selected items
the list of selected items populated using jquery ui (sortable) via drag&drop. items above can repeated as user wants. , want pass controller data selected dropdowns , lists of selected items.
i have no idea how can use @model
or viewbag
because selected items list empty , gets populated on client side. side note, don't need list of available stuff.
update:
i've changed question because i'm willing put data in form , gave idea use javascript collect data , make request controller. i'm trying use formcollection
data. problem when submit form formcollection
has no data in it.
update 2:
after looking formcollection , modelbinding i've came upon impediment. can't items on form don't have name
property. problem <ul>
or <li>
elements don't have name
attribute. question be, how can data elements using above mentioned methods if don't have name
?
i have found solution: gave on using lists , moved using select multiple
ui.multiselect
plugin. solved problem select has name attribute , can data using formcollection
.
Comments
Post a Comment