how can i get object as data from checkbox array ? #1737
Unanswered
Eric-Juquel
asked this question in
General
Replies: 1 comment
-
please provide a simple codesandbox for your problem. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi , checkbox Array works well for me , but as i map an array of objects to generate my checkbox array , i would like to get array of complete objects with all properties as value instead of an array of string with each object name , i tried many ways without success . do you know how can i manage it please ?
there is the part of my script :
{ watchTemplateName && getFeaturesByCategory().map((features, i) => { return ( <div className={
${classes.column} item} key={
${features}${i}}> <div className={ classes.title }>{ features[0].category }</div> <div className={ classes.modes }> { features.map((feature, i) => { return ( <div key={
${feature}${i}}> <label>{ feature.name }</label> <input type='checkbox' name='features' value={ feature.name } ref={ register } /> </div> ) }) } </div> </div> ) }) }
Beta Was this translation helpful? Give feedback.
All reactions