Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleForm Radio Buttons Not Validate #57

Closed
danieldocki opened this issue May 15, 2015 · 1 comment
Closed

SimpleForm Radio Buttons Not Validate #57

danieldocki opened this issue May 15, 2015 · 1 comment

Comments

@danieldocki
Copy link

Hi Guys,

I'm using SimpleForm. Judge return valid, but radio is not selected.

I suspect he returns valid because the tag 'value' has value, which is 'male' and 'female', have any solutions?

    <%= f.input :gender, required: true, collection: [[:male, t('male')],
      [:female, t('female')]], label_method: :last, value_method: :first,
      as: :radio_buttons, item_wrapper_class: 'radio-inline', validate: true %>
<div class="form-group radio_buttons required user_gender">
  <label class="radio_buttons required control-label">
    <abbr title="obrigatório">*</abbr> sexo
  </label>

  <span class="radio radio-inline radio__label">
    <input class="radio_buttons required form-control" 
      data-validate="[{&quot;kind&quot;:&quot;presence&quot;,&quot;options&quot;:{},&quot;messages&quot;:{&quot;blank&quot;:&quot;não pode ficar em branco&quot;}}]"
      data-klass="User" type="radio" value="male" name="user[gender]" id="user_gender_male">
    <label class="collection_radio_buttons" for="user_gender_male">papai</label>
  </span>

  <span class="radio radio-inline radio__label">
    <input class="radio_buttons required form-control"
      data-validate="[{&quot;kind&quot;:&quot;presence&quot;,&quot;options&quot;:{},&quot;messages&quot;:{&quot;blank&quot;:&quot;não pode ficar em branco&quot;}}]"
      data-klass="User" type="radio" value="female" name="user[gender]" id="user_gender_female">
    <label class="collection_radio_buttons" for="user_gender_female">mamãe</label>
  </span>
</div>

Thanks :)

@jamesmk
Copy link
Collaborator

jamesmk commented May 16, 2015

Thanks for the bug report. I'm going to close this because it was already reported here: #33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants