I am working on React project, In that project I have a scenario that is I have to write
Condition for Input tag. The Condition wants to be like this, In my form the Input tag type is
Number, and its min Value is 1001 and max value is 1500. So now what I want is If I type number
Less than 1001 then it should not take that number in Input tag. Someone please help me how to
Write logic like this.
This is Form.js
import React from 'react';
import './aum-company-modal.css';
import { Button, Col, Modal, ModalBody, ModalFooter, ModalHeader, Row, FormGroup, Label, Input, } from 'reactstrap';
const AumCompanyModal = () => {
return (
<Row>
<Col md="6" sm="6" xs="6">
<Modal isOpen
>
<ModalHeader >Add new</ModalHeader>
<ModalBody>
<Row>
<Col md="12" sm="12" xs="12">
<FormGroup>
<Label for="exampleName">Min Value</Label>
<Input
type="text"
name="roleName"
placeholder="Enter minimum value"
value='1000'
/>
</FormGroup>
<FormGroup>
<Label for="exampleName">Max Value</Label>
<Input
type="number"
name="roleName"
placeholder="Enter maximum value"
min='1001' max='1500'
/>
</FormGroup>
</Col>
</Row>
</ModalBody>
<ModalFooter>
<Button color="secondary">
Cancel
</Button>
<Button type="submit" color="primary">
Submit
</Button>
</ModalFooter>
</Modal>
</Col>
</Row>
)
}
export default AumCompanyModal