<![CDATA[ @SELECT - cannot select first item drop down list - My Forums]]> https://forums.modx.com/thread/?thread=7760 <![CDATA[Re: @SELECT - cannot select first item drop down list]]> https://forums.modx.com/thread/7760/select---cannot-select-first-item-drop-down-list#dis-post-46696

Regarding the prefix, the MODx docs on this site still say {PREFIX} which didn’t work hence the hard-coding. I’m glad to know what does work now, as I didnt’ like fixing it! Are the docs on this site dying (need documentation editors?)]]>
pbowyer Jul 23, 2007, 01:00 PM https://forums.modx.com/thread/7760/select---cannot-select-first-item-drop-down-list#dis-post-46696
<![CDATA[Re: @SELECT - cannot select first item drop down list]]> https://forums.modx.com/thread/7760/select---cannot-select-first-item-drop-down-list#dis-post-46695
@SELECT 'Make a Selection' AS pagetitle, '-' AS id UNION SELECT pagetitle,id FROM modx_site_content WHERE parent=20
Also, I recommend changing the hardcoded [tt]modx_[/tt] to [tt][+PREFIX+][/tt] like so:
@SELECT 'Make a Selection' AS pagetitle, '-' AS id UNION SELECT pagetitle,id FROM [+PREFIX+]site_content WHERE parent=20
That way, you can change your prefix in the future without trouble smiley

You also might want to update your TV’s "Default Value" to "[tt]-[/tt]" (without the quotes) so your TV Content Values table doesn’t get cluttered.

Enjoy!]]>
sirlancelot Jul 23, 2007, 12:47 PM https://forums.modx.com/thread/7760/select---cannot-select-first-item-drop-down-list#dis-post-46695
<![CDATA[@SELECT - cannot select first item drop down list]]> https://forums.modx.com/thread/7760/select---cannot-select-first-item-drop-down-list#dis-post-46694
I use a number of drop down list menu TVs in my MODx site. Much of the data is obtained using @SELECT.
@SELECT pagetitle,id FROM modx_site_content WHERE parent=20


My problem is it’s impossible to select (and save) the value of the first item in the drop down box, unless the user selects the 2nd item from the drop-down and then selects the 1st item.

Is there a way to get it to insert a blank-valued "Select an Option" line inserted as the default choice, so this problem doesn’t happen?]]>
pbowyer Jul 23, 2007, 05:53 AM https://forums.modx.com/thread/7760/select---cannot-select-first-item-drop-down-list#dis-post-46694