Last active
June 25, 2017 08:07
-
-
Save martinyung/794dcdaf75ecc3c015b1ae4605d5f72f to your computer and use it in GitHub Desktop.
conversational-form with react.js - render()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hello extends Component { | |
... | |
render() { | |
return ( | |
<div> | |
<h2>Conversational Form</h2> | |
<div id="cf-context" > {/* <-- the cf form will be bound to this element */} | |
<form id="form" className="form" ref="form"> | |
<input type="text" ref="name" placeholder="Name" defaultValue={this.props.name}/> | |
<input type="email" ref="email" placeholder="Email" defaultValue={this.props.email}/> | |
<select ref="description" type="radio" id="links"> {/* <-- using selection for options */} | |
<option value="request_1">Request 1</option> | |
<option value="request_2">Request 2</option> | |
</select> | |
</form> | |
</div> | |
</div> | |
); | |
} | |
} | |
export default Hello; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment