I haven’t tried it but it might work to just add this in front of the @EVAL:
[Update] Sorry, doesn’t work. It looks like @EVAL has to be the first thing on the line.
You can give the TV a default value that will be set if nothing is chosen:
That won’t give you a NULL value, but you should be able to identify no selection in your code (and translate it to NULL if you want). I can’t think of any easy way to put "No Selection" at the top of the list, but maybe someone else can.
Bob, thanks for your reply.
yes, it looks like Mr. @EVIL does not ecxept any double pipe constructions, neither before nor after himself, I had tried that too.
also I had no luck with your second suggestion, a default that’s not defined in the option values does not show up in my lists.
hm .... looks like this has to be done in a php snippet.
Indeed - @EVAL $modx->runSnippet(’’mySnippet").
But *please* don’t do this where $s is subsequently used in an SQL statement:
$s=$_GET[’id’]
At the minimum ensure the global is an integer:
$s = intval($_GET[’id’]);