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

How to Set Values in SelectWidget - Getting values from states #125

Open
gauravverma029 opened this issue Feb 28, 2018 · 2 comments
Open

Comments

@gauravverma029
Copy link

I am getting my value in state.those values in state i want selected in SelectWidget. And after i can change from female to Male.

this.state = {
gender:F
}
<GiftedForm.ModalWidget
title='Gender'
displayValue='gender'
image={require('../../assets/icons/color/gender.png')}
>
<GiftedForm.SeparatorWidget />

      <GiftedForm.SelectWidget name='gender' title='Gender' multiple={false}>
        <GiftedForm.OptionWidget image={require('../../assets/icons/color/female.png')} title='Female' value='F'/>
        <GiftedForm.OptionWidget image={require('../../assets/icons/color/male.png')} title='Male' value='M'/>
      </GiftedForm.SelectWidget>
    </GiftedForm.ModalWidget>
@eliasturbay
Copy link

Hey @gauravverma029. It's on the docs, check the readme file:

      <GiftedForm
        formName='signupForm'
        defaults={{
          'gender{M}': true
        }}

@kimngoc0347
Copy link

if you set default value with code 'gender{M}': true, it will display 'M' instead of 'Made'.

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

3 participants