DEV Community

rajesh
rajesh

Posted on

React JS Online training

Visualpath is offering Job oriented React JS Online Training by certified professionals in Hyderabad. Join this course to learn react js from basics to advanced level with real time examples and project scenarios. Contact us @ +919989971070 to schedule your free demo.

https://www.visualpath.in/ReactJs-Training-in-Hyderabad.html

Top comments (2)

Collapse
 
npips1991 profile image
Narendra Patel

how to click radio button get value in React js
import React, { PureComponent } from 'react'
import { Segment, Button, Icon, Message, Form } from 'semantic-ui-react';
import { Field, FieldArray, reduxForm } from 'redux-form';
import _filter from 'lodash/filter'
import _includes from 'lodash/includes'
import MainBodyHeader from '../../Shared/MainbodyHeader';
import { Radio } from '../../Inputs';

class AddQuestion extends PureComponent {

    state = {
        type: ''
    }


renderselecttype(event) {
      this.setState({
       type: event.target.value
    });
  }


render() {
    console.log(this.state.type);

    return (
        <>
            <MainBodyHeader
                title={'Add Quiz Question'}
                hasIcon={false}
                search={true}
                placeholder={''}
            />
            <Segment className='maincontent'>
                <Segment>
                    <Form id="addquestion">
                    <h2>Course Name : <span className='faded-text'> On Boarding</span></h2>
                        <Form.Group>
                            &nbsp;&nbsp;
                            <label><b>Please Select Type</b></label><br />
                            <Field name='type' component={Radio}
                                label='Multiple Select' radioValue='multiple_select'
                                onClick={this.renderselecttype}
                            />
                            <Field name='type' component={Radio}
                                label='Single Select(truefalse)' radioValue='single_select'
                                onClick={this.renderselecttype}
                            />
                        </Form.Group>
                    </Form>
                </Segment>
            </Segment>
        </>
    )
}

}
const formWrapperStep = reduxForm({
form: 'addquestion',
})(AddQuestion)

export default formWrapperStep;

Collapse
 
highcenburg profile image
Vicente G. Reyes

Hi, could you please post more context on this article? Thanks.