Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { Input, Dropdown, TextArea, Form, Button, Header, Checkbox } from 'semantic-ui-react'
  3.  
  4. class PageTwo extends Component {
  5. constructor(props){
  6. super(props)
  7. this.state = {
  8. programAgreement: false;
  9.  
  10. }
  11. this.handleInputChange = this.handleInputChange.bind(this);
  12.  
  13.  
  14. }
  15.  
  16.  
  17. handleInputChange(event) {
  18. const target = event.target;
  19. const value = target.type === 'checkbox' ? target.checked : target.value;
  20. const name = target.name;
  21.  
  22. console.log(`Input name ${name}. Input value ${value}.`);
  23.  
  24. this.setState({
  25. [name]: value
  26. });
  27. }
  28.  
  29. <Checkbox
  30.  
  31.  
  32.  
  33. placeholder="I Agree"
  34. name="programAgreement"
  35. type="checkbox"
  36. checked={this.state.programAgreement}
  37. onChange={this.handleInputChange} />
  38. />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement