Closed techpawan closed 2 years ago
import React from 'react' import ReactDom from 'react-dom'; import { DocsLink } from 'src/reusable' import { CButton, CCard, CCardBody, CCardFooter, CCol, CContainer, CForm, CInput, CInputGroup, CInputGroupPrepend, CInputGroupText, CRow, CCardHeader, CProgress, CProgressBar } from '@coreui/react' import CIcon from '@coreui/icons-react'
class Register extends React.Component { constructor(props) { super(props); this.t this.onRegisterUser = this.onRegisterUser.bind(this); this.state = { showMe: false, message: '' }; } changeHandler = e => { this.setState({ [e.target.name]: e.target.value }) } //on click function onRegisterUser = () => { this.setState({ showMe: true })
const {parse, stringify} = require('flatted/cjs'); let appUser = { PassWord:'ddd',//this.state.bind(password), EmailId: 'ddd',//this.state.bind(email), UserName: 'ddd',//this.state.bind(username), MobileNumber: 'ddd',//this.state.bind(mobilenumber) }; fetch('https://localhost:44380/api/AppUsers', { mode: 'no-cors' }, { method: 'POST', headers: { 'Content-type': 'application/json', 'Access-Control-Allow-Headers': '*' }, body: appUser//{ PassWord: this.password, EmailId: this.email, UserName: this.username, MobileNumber: this.mobilenumber } }) .then(response => response.json()) .then(data => this.setState({ message: 'Registred Successfully' })); // .then(res => { // if (res.JSON()) { // let data = res; // this.setState({ message: 'Registred Successfully' }); // } // });
}
render() { const {username,email, mobilenumber, password, repeatpassword } = this.state return (
Create your account
)
} }
const element = ReactDom.render(element, document.getElementById('root')); export default Register
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions
import React from 'react' import ReactDom from 'react-dom'; import { DocsLink } from 'src/reusable' import { CButton, CCard, CCardBody, CCardFooter, CCol, CContainer, CForm, CInput, CInputGroup, CInputGroupPrepend, CInputGroupText, CRow, CCardHeader, CProgress, CProgressBar } from '@coreui/react' import CIcon from '@coreui/icons-react'
class Register extends React.Component { constructor(props) { super(props); this.t this.onRegisterUser = this.onRegisterUser.bind(this); this.state = { showMe: false, message: '' }; } changeHandler = e => { this.setState({ [e.target.name]: e.target.value }) } //on click function onRegisterUser = () => { this.setState({ showMe: true })
}
render() { const {username,email, mobilenumber, password, repeatpassword } = this.state return (
Register
Create your account
{ this.state.showMe ?Registration In Progress!!
} }
const element =
ReactDom.render(element, document.getElementById('root'));
export default Register