We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14372
    • 49 Posts
    In the registration form I want to include Gender and my work was to integrate a template I had been given in HTML into Modx ... now, in the template, choosing gender was via radios ... something like this ...

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


    I need to get the male and female values to a placeholder such as [[+gender]] so that I can use it in a profile. Modx provides the [gender] field for user profiles so its not an extended profile.

    Now that we’ve got selects out of the way, if I can just figure this one out that would be it! Because checkboxes and radios work in the same way.

    Check out how FormIt does it ...


    <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>

      • 14372
      • 49 Posts
      It WORKED! But I must admit .. it was kinda a mistake

      This was my code ...

                <label for="employment">Employment : </label>
                <ul>
                  <li>
                    <label for="radio-choice-1" class="radio_label">Full-time</label>
                    <input class="radio" type="radio" name="employment" id="radio-choice-1" tabindex="21" checked value="Full-time" />
                  </li>
      
                  <li>
                    <label for="radio-choice-2" class="radio_label">Part-time</label>
                    <input class="radio" type="radio" name="employment" id="radio-choice-2" tabindex="22" value="Part-time" />
                  </li>
                </ul>


      When I called the [[+employment]] placholder it had been filled with the value e.g. Part-time or Full-time.

      AWESOME.
        • 25308
        • 46 Posts
        Quote from: itsmrwave at Apr 13, 2011, 02:16 AM

        It WORKED! But I must admit .. it was kinda a mistake

        This was my code ...

                  <label for="employment">Employment : </label>
                  <ul>
                    <li>
                      <label for="radio-choice-1" class="radio_label">Full-time</label>
                      <input class="radio" type="radio" name="employment" id="radio-choice-1" tabindex="21" checked value="Full-time" />
                    </li>
        
                    <li>
                      <label for="radio-choice-2" class="radio_label">Part-time</label>
                      <input class="radio" type="radio" name="employment" id="radio-choice-2" tabindex="22" value="Part-time" />
                    </li>
                  </ul>


        When I called the [[+employment]] placholder it had been filled with the value e.g. Part-time or Full-time.

        AWESOME.

        Very cool. I’m glad it worked out for you. grin grin grin Thanks for letting me know how it ended up. If you ever have another question,..feel free to let me know.