Hi,
I want to know the method that how can I populate my select drop down with data of my registered users in MIGX form creator.
I have tbl_registered_user and i want to get data as Full Name and user_id and populate select dropdown instead of text field with user data.
Thnx
inputTVtype: listbox
input option values: @CHUNK getUserList
and create a chunk getUserList with:
[[migxLoopCollection?
&classname=`modUserProfile`
&tpl=`@CODE:[[+fullname]]==[[+internalKey]]`
&outputSeparator=`||`
]]
you can try this snippet-call at frontend, before using it for the input-options, if it returns what you need.
Where should I put this code? Cause it didn't get location where that form is being created. I need this on backend modx manager..
Thnx
[ed. note: mujtabaahmad1985 last edited this post 12 years, 2 months ago.]
Didn't you create a MIGX-configuration in the MIGX-Configuration-CMP?
Components->MIGX
Tab MIGX
right-click on your configuration in the grid -> edit
tab formtabs
there are the tabs for your form with their fields
edit your field
Tab 'Input Options'
field 'Input Option Values'
here put:
and create that chunk with the migxLoopCollection-snippet-call
I want to fetch user from my custom table like tbl_useraccounts.. then what will be class in this case.... cause users are being registered via my custom coding not using any plugin.....
you should create a xpdo-schema and a package for your custom-table(-set), if you haven't allready
then you can do
[[migxLoopCollection?
&packageName=`yourpackage`
&classname=`yourClass`
&tpl=`@CODE:[[+fullname]]==[[+id]]`
&outputSeparator=`||`
]]
or you can try the @SELECT-binding
http://rtfm.modx.com/revolution/2.x/making-sites-with-modx/customizing-content/template-variables/bindings/select-binding
Select binding is working fine. But when i save some data against dropdown it saves client name as key, check in attach document
whats your current select-binding, please?
@SELECT `user_name` AS `name`,`user_id` FROM `[[+PREFIX]]useraccounts`
I just put this line into inputOption -> Value
try
@SELECT `user_name` AS `name` FROM `[[+PREFIX]]useraccounts`