Skip to content

Commit 1d5dd39

Browse files
nikhilgupta30apollonian
authored andcommitted
Added alert if input is greater than 10
1 parent 3e9095f commit 1d5dd39

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/demo/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ class Demo extends Component {
2323
handleChange = e => {
2424
let currVal = e.target.value;
2525
if(currVal<0) currVal = 0;
26-
if(currVal>10) currVal = 10;
26+
if(currVal>10){
27+
currVal = 10;
28+
alert("No. of Inputs cannot be greater than 10");
29+
}
2730
this.setState({ [e.target.name]: currVal });
2831
};
2932

0 commit comments

Comments
 (0)