A replacement for select+multi+values
It took like three hours.. at lest. This is in a section and is included from an edit template. It's a bit trickier than expected because Formfieldx is a reference to another topic, like we don't save the Contact's full name in an
OrderForm? , we just save the topic name of the Contact, so it's a reference, they are AUTOINC'ed. Hm, this only saves one value even if two are selected....changing formfield to textboxlist helped that. Almost....well, not perfect per se... but many SEARCH'es in a data form got really bad performance.
...there! now works perfect. Regex match with word boundry match. Thank you guys who made the Query search.
<select name="Formfieldx" multiple size="5">%SEARCH{
"form.name='SomeForm'"
separator=", "
type="query"
nonoise="on"
order="formfield(Sortfield)"
format="<option value=\"$topic\" $percntIF{ \"'$percntBASETOPIC$percnt'/Formfieldx=~'\b$topic\b'\" then=\"selected\" else=\"nada\" }$percnt > $formfield(Showthis) $formfield(Andthis) </option>" }%
</select>
The select word could be in the search with header and footer but I had so so so many tries before it worked, so it was better to simplify the search as much as possible.. And I guess anytime now someone will say 'why didn't you just..' hmrpf!
--
LarsEik - 31 Oct 2011
This topic: Sandbox
> SelectOptionSelected
Topic revision:
01 Nov 2011, LarsEik
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. 
