Try to search your question here, if you can't find : Ask Any Question Now ?

radio button value is not shown when submitting form

HomeCategory: stackoverflowradio button value is not shown when submitting form
Avatarbhawya asked 4 months ago

I am using redux form for the form elements. The textfield values are shown when submitting but the radio button values is not shown. When i submit the form, i can get the values for email, pass but not role which is a radio button. I have just used {...input} in the input element because it should be suffice, i think.

Here is how i have done


const CardToggle = ({ input, meta: { touched, error }, ...props }) => {
  return (
        <StyledInput {...input} type="radio" />
      {touched && error && <span>{error}</span>}

export default CardToggle;

submit = (values, mutation) => {
  console.log('values', values);
  // mutation({ variables: values });

  onSubmit={handleSubmit(val => this.submit(val, mutation))}
  <Field name="email" label="Email" component={TextField} />
  <Field name="password" label="Password" component={TextField} />
  <AccountType />

  <Field name="role" component={CardToggle} value="enduser">
    <UserIcon size={60} />
    <Title>End User</Title>
  <Field name="role" component={CardToggle} value="company">
    <CompanyIcon size={60} />
1 Answers
Best Answer
AvatarAmit answered 4 months ago
Your Answer

0 + 4 =

Popular Tags

WP Facebook Auto Publish Powered By :