We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1526
    • 72 Posts
    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 12 years ago.]
      MODx evo 1.5~1.6 ✪ Apache v 2.2.22 ✪ PHP v 5.3.10 ✪ MySQL v 5.1.61
      <°'iiii);