last day (17 days later) » 

11:16 AM
0
Q: Input field <text> is clearing the entered data if I click on any thing in a page other than input field - react js

Prajna HegdeI have a page with an input box, and a check box below. And a submit button. When I enter anything in input box and check or uncheck any checkboxes, the entered text will be disappearing. How can I solve this problem? handleChange = (event) => { this.setState({ [event.target.name]: even...

 
Now I have added @Treycos
 
What is the value of your this.state.name ?
 
It is a check box name, In my case it is ignore which I am passing for the method hangleCheckBox @HarishSoni
 
And what it for input?
 
It is just to assign a value for area-label @HarishSoni
 
11:16 AM
For checkbox it is ignore and for input what is the value of name I want to know this.!
 
There is no name for input text field
 
you need to pass it. if there is no name everytime the state will reset when something changes.
 
If I pass name, then also it is happening the same
 
Can you create a demo of this?
 
11:37 AM
?
 
11:48 AM
Actually, I don't know how to create demo, I will make it by tomorrow morning
 
Cool no problem we can continue this discussion on this link
 
okay
 
 
4 hours later…
3:52 PM
One way to create a demo is to go to codesandbox.io. Click Create Sandbox. Then click the "React" choice.
Then you can easily create a working version of the code that you can share with others.
 

  last day (17 days later) »