We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14372
    • 49 Posts
    Any one know how to handle selects, checkboxes and radios when creating a new user profile ...

    FormIt is able to do this but there is no way to integrate it with modx user accounts ...

            <!-- Personal:Gender -->
            <li>
              <label>Gender :  
                <span>*</span>
                <span class="error">[[+error.gender]]</span>
              </label>
              <ul>
                <li>
                  <label for="gender" class="radio_label">male</label>
                  <input class="radio" type="radio" name="gender" id="radio-choice-1" tabindex="9" checked="checked" value="[[+gender]]" />
                </li>
                <li>
                  <label for="gender" class="radio_label">female</label>
                  <input class="radio" type="radio" name="gender" id="radio-choice-2" tabindex="10" value="[[+gender]]" />
                </li>
              </ul>
            </li>
            


    Problem with this is the the [[+gender]] placeholder does not get the value to be input.

    If only there was a way ... something like this

    [[+gender=`male`]]


    Anyone with ideas.

    FormIt example is ...

    <select name="color">
       <option value="blue" [[!+fi.color:FormItIsSelected=`blue`]] >Blue</option>
       <option value="red" [[!+fi.color:FormItIsSelected=`red`]] >Red</option>
       <option value="green" [[!+fi.color:FormItIsSelected=`green`]] >Green</option>
    </select>


    See how it assigns the value back to the snippet?

    Hope I’m making sense.

    All I want to do is to be able to return a certain value back to the placeholder.
      • 14372
      • 49 Posts
      Hey guys I think I nailed it ... haven’t tried it thought but I’m 90% sure that this will work...

      [[+name:default=`anonymous`]]


      +name is the placehoder with the default/ifempty/empty output modifier and the default value ’anonymous’

      I found this idea here ... http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+(Output+Modifiers)

      UPDATE 1:

      This did not work, failed miserably BUT!

      I got a solution for selects from the forums thanks to ’Robot Love’

      <label>Would you like to receive promotions on special deals? <span class="error">[[+error.notifications]]</span> <br />
          <select name="promotions">
         <option value="yes">Yes</option>
         <option value="no">No</option>
      </select></label>


      Then use the [[+promotions]] placeholder
        • 36972
        • 8 Posts
        Here's how to handle selects/radios using Login.Register - or any form submitting snippet:

        <select name="salutation">
           <option value="Mr" [[!+reg.salutation:is=`Mr`:then=`selected`]]>Mr</option>
           <option value="Mrs" [[!+reg.salutation:is=`Mrs`:then=`selected`]]>Mrs</option>
           <option value="Miss" [[!+reg.salutation:is=`Miss`:then=`selected`]]>Miss</option>
           <option value="Ms" [[!+reg.salutation:is=`Ms`:then=`selected`]]>Ms</option>
           <option value="Dr" [[!+reg.salutation:is=`Dr`:then=`selected`]]>Dr</option>
        </select>
        
          • 42146
          • 73 Posts
          Quote from: jaylearn at Dec 10, 2011, 11:12 PM
          Here's how to handle selects/radios using Login.Register - or any form submitting snippet:

          <select name="salutation">
             <option value="Mr" [[!+reg.salutation:is="`Mr`:then=`selected`]]">Mr</option>
             <option value="Mrs" [[!+reg.salutation:is="`Mrs`:then=`selected`]]">Mrs</option>
             <option value="Miss" [[!+reg.salutation:is="`Miss`:then=`selected`]]">Miss</option>
             <option value="Ms" [[!+reg.salutation:is="`Ms`:then=`selected`]]">Ms</option>
             <option value="Dr" [[!+reg.salutation:is="`Dr`:then=`selected`]]">Dr</option>
          </select>
          

          Thanks a ton for that, works like a charm
          I had the same issue. Found the formit example but nothing on how login handled it. way to much time spend on trying to figure out the right syntax.
            • 8168
            • 1,118 Posts
            Quote from: jstump at Nov 22, 2012, 10:25 PM
            Quote from: jaylearn at Dec 10, 2011, 11:12 PM
            Here's how to handle selects/radios using Login.Register - or any form submitting snippet:

            <select name="salutation">
               <option value="Mr" [[!+reg.salutation:is="`Mr`:then=`selected`]]">Mr</option>
               <option value="Mrs" [[!+reg.salutation:is="`Mrs`:then=`selected`]]">Mrs</option>
               <option value="Miss" [[!+reg.salutation:is="`Miss`:then=`selected`]]">Miss</option>
               <option value="Ms" [[!+reg.salutation:is="`Ms`:then=`selected`]]">Ms</option>
               <option value="Dr" [[!+reg.salutation:is="`Dr`:then=`selected`]]">Dr</option>
            </select>
            

            Thanks a ton for that, works like a charm
            I had the same issue. Found the formit example but nothing on how login handled it. way to much time spend on trying to figure out the right syntax.

            Any idea how to handle the <select> form element when its allowed to submit more than 1 value???
              • 8168
              • 1,118 Posts
              Quote from: jaylearn at Dec 10, 2011, 11:12 PM
              Here's how to handle selects/radios using Login.Register - or any form submitting snippet:

              <select name="salutation">
                 <option value="Mr" [[!+reg.salutation:is="`Mr`:then=`selected`]]">Mr</option>
                 <option value="Mrs" [[!+reg.salutation:is="`Mrs`:then=`selected`]]">Mrs</option>
                 <option value="Miss" [[!+reg.salutation:is="`Miss`:then=`selected`]]">Miss</option>
                 <option value="Ms" [[!+reg.salutation:is="`Ms`:then=`selected`]]">Ms</option>
                 <option value="Dr" [[!+reg.salutation:is="`Dr`:then=`selected`]]">Dr</option>
              </select>
              

              Any idea how to handle the <select> form element when its allowed to submit more than 1 value???
                • 3749
                • 24,544 Posts
                This might be what you want: https://forums.modx.com/thread/72924/solved---register-checkboxes-and-usergroups. If it's any consolation, it always takes me several tries and some debugging to get those right. wink
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting