Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Created April 21, 2020 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/0fb3c9dacca6e97ffe7e4c62cf5d2ed5 to your computer and use it in GitHub Desktop.
Save McLarenCollege/0fb3c9dacca6e97ffe7e4c62cf5d2ed5 to your computer and use it in GitHub Desktop.
import React from "react";
class EnquiryForm extends React.Component {
state = {
customerName: '',
};
constructor(props) {
super(props);
this.handelNameChange = this.handelNameChange.bind(this);
}
handelNameChange(event) {
this.setState({
customerName: event.target.value
});
}
render() {
return (
<div>
<form>
<div>
<label htmlFor="customerName">Your Name:</label>
<input type="text" name="customerName" value={this.state.customerName}
onChange={this.handelNameChange}/>
</div>
</form>
</div>
);
}
}
export default EnquiryForm;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment