On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • I'm trying to add the attribute
    selected="selected"
    to opiton values based on their value, but my code doesn't work:
                <label for="[+maxigallery.fieldnames.unit+]">units:</label> 
                <select name="[+maxigallery.fieldnames.unit+]" id="[+maxigallery.fieldnames.unit+]" value="[+maxigallery.picture.unit:htmlent+]" onkeydown="document.editform.[+maxigallery.fieldnames.modified+].value='yes'">
                    <option value="mm" [+maxigallery.picture.unit:htmlent:is=`mm`:then=`selected="selected"`+]>mm</option>
                    <option value="cm" [+maxigallery.picture.unit:htmlent:is=`cm`:then=`selected="selected"`+]>cm</option>
                    <option value="m" [+maxigallery.picture.unit:htmlent:is=`m`:then=`selected="selected"`+]>m</option>
                    <option value="variable" [+maxigallery.picture.unit:htmlent:is=`variable`:then=`selected="selected"`+]>variable</option>
                </select>

    no one of the values has the attribute. Where am I wrong?
    This is a template of a Maxigallery (beta) module, on evo. [ed. note: andrearicci last edited this post 7 years, 5 months ago.]
      MODx evo 1.5~1.6 ✪ Apache v 2.2.22 ✪ PHP v 5.3.10 ✪ MySQL v 5.1.61
      <°'iiii);