daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from 'react';
  2. // import logo from './logo.svg';
  3. import './App.css';
  4. // var firebase = require('firebase');
  5. // var uuid = require('uuid');
  6.  
  7.  
  8.     class App extends Component {
  9.       constructor(props){
  10.         super(props);
  11.  
  12.         this.state = {qualification:''};
  13.         // this.submitData = this.submitData.bind(this);
  14.         this.inputData = this.inputData.bind(this);
  15.       }
  16.       // submitData(event)
  17.       // {
  18.       //
  19.       // }
  20.       inputData(event)
  21.       {
  22.         this.setState({[event.target.name]: event.target.value});
  23.         console.log(this.state.qualification);
  24.       }
  25.       render() {
  26.         return (
  27.           <div>
  28.             <form>
  29.             <div class="btn-group">
  30.           <button type="button" class="btn btn-primary btn-ch dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  31.             Qualification
  32.           </button>
  33.           <div class="dropdown-menu dropdown-ch dropdown-menu-right">
  34.             <button class="dropdown-item" type="button" value="Gynaec" onChange={this.inputData} name="qualification">Gynaec</button>
  35.             <button class="dropdown-item" type="button" value="Medicine" onChange={this.inputData} name="qualification">Medicine</button>
  36.             <button class="dropdown-item" type="button" value="Surgery" onChange={this.inputData} name="qualification">Surgery</button>
  37.           </div>
  38.         </div>
  39.         <button>Submit</button>
  40.       </form>
  41.           </div>
  42.         );
  43.       }
  44.     }
  45.  
  46.     export default App;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top