Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import { Input, Dropdown, TextArea, Form, Button, Header, Checkbox } from 'semantic-ui-react'
- class PageTwo extends Component {
- constructor(props){
- super(props)
- this.state = {
- programAgreement: false;
- }
- this.handleInputChange = this.handleInputChange.bind(this);
- }
- handleInputChange(event) {
- const target = event.target;
- const value = target.type === 'checkbox' ? target.checked : target.value;
- const name = target.name;
- console.log(`Input name ${name}. Input value ${value}.`);
- this.setState({
- [name]: value
- });
- }
- <Checkbox
- placeholder="I Agree"
- name="programAgreement"
- type="checkbox"
- checked={this.state.programAgreement}
- onChange={this.handleInputChange} />
- />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement