T
T
ThomasScott2021-02-07 22:59:44
React
ThomasScott, 2021-02-07 22:59:44

How to make it so that when the button is clicked, the seconds taken from the URL (sec variable) start counting and the timer is displayed on the button?

return (
            <Container className="mt-5" style={{width: '400px'}}>
                <h1 className = "text-center mb-2">Example Form</h1>
                <Form>
                    <div className="panel panel-default text-center">
                        <FormErrors formErrors={this.state.formErrors} />
                    </div>
                    <Form.Group>
                        <input
                            placeholder="Enter number"
                            type="number" className="form-control" name="sec"
                            value={this.state.sec}
                            onChange={this.handleUserInput} 
                        />
                    </Form.Group>

                    <Button id="sendNumber" className="btn btn-primary btn-block" type="submit" disabled={!this.state.formValid}>Send nubmer</Button>
                </Form>
            </Container>
        );

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question