We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16842
    • 4 Posts
    Hey All,

    I’m creating a TV Dropdown List menu that is populated by a @SELECT statement. I would like to leave an empty line at the top of the List menu in case users do not want to choose an option. This would then leave the output blank.

    Any ideas, other than inserting a blank line into the database table?
      • 4172
      • 5,888 Posts
      you can try something like that, all in one line or create a snippet with this code and use api-function runSnippet:

      @EVAL $rs= $modx->db->select('pagetitle,id',$modx->getFullTablename('site_content'),'parent=12');$rows=$modx->db->makeArray($rs);$output[]='choose one';foreach($rows as $row){$output[]=$row['pagetitle'].'=='.$id;}return $output;
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!