We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1576
    • 24 Posts
    Hi,

    I’m trying to create a Register page using the Login module with custom fields.

    I want create a radio button with two possible values, e.g.:

    <input type="radio" name="customField:required" value="valueOne" />
    <input type="radio" name="customField:required" value="valueTwo" />


    I want this to submit to the user profile, so I can output [[+customField]] there with one of the above values.

    However, the only way I know of, right now, to create an extended field on a page with the [[!Register]] snippet is as follows:
    <input type="text" name="customField:required" value="[[+customField]]" />


    But doing this doesn’t submit a value at all:
    <input type="radio" name="customField:required" value="[[+valueOne]]" />
    <input type="radio" name="customField:required" value="[[+valueTwo]]" />


    The form simply won’t submit. It treats the value attributes as empty.

    Any suggestions would be greatly appreciated. Thanks!
      • 35064
      • 13 Posts
      any suggestions?

      also trying to add radio buttons
        • 25586
        • 105 Posts
        I need this functionality aswell smiley
          • 36875
          • 5 Posts
          You have used this as an example:

          <input type="text" name="customField:required" value="[[+customField]]" />


          But in this example the point of placeholder in ’value’ is simply to hold on to the value the user typed if the form comes back with errors after validation. The placeholder is not set to anything the first time the user loads the form.

          Likewise, if you do this:

          <input type="radio" name="customField:required" value="[[+valueOne]]" />
          <input type="radio" name="customField:required" value="[[+valueTwo]]" />


          you’re using placeholders to set the value of the radio buttons but those placeholders have not been set to anything.

          You can set the values through some custom snippet of your own, or simply do something like this:

          <input type="radio" name="customField:required" value="blue" />
          <input type="radio" name="customField:required" value="red" />


            • 35064
            • 13 Posts


            <input type="radio" name="customField:required" value="blue" />
            <input type="radio" name="customField:required" value="red" />


            But it must be stored.
            I was trying to use modifiers like in solution for check box. something like that
            <input type='radio' name='m4' id='m4' value="[[!+option2]]"[[!+option2:is=`1`:then=`checked="checked"`]] />

            but did not solve..
              • 36875
              • 5 Posts
              @inclub: I’m not sure I understand what you are trying to do. Are you building a registration form or a profile page?