This is actually really cool. I was stuck trying to figure out a good way to delete an element from my list until I found this video. I did not know you could pass a unique identifier to a particular object of the map function. Thank you very much.
This is actually really great! It would be helpful if you also show how to add a text field with default information already inside it as well. But great video! I hope you continue making more!
Bro can you make this. Table 1)Every table row has a checkbox. 2) when you click on check box delete button will appear when you click on button hole row will delete 3) delete all button also there on top of table.
const [formData, setFormData] = useState({ sapno: "", sapimage: "", pits: [{ pitno: "", pitimages: [] ,url:''}], }); with this being our form structure, the pit number and url are being deleted but the image of the last input index is being deleted and not respective to the pit number and url. please help us with this
I think the correct index is passing for the pit number and url. The same index is not passing in the image. So maintain in a separate state and use the State. Maybe this will work
I had a small problem while returning the Input and button , I was map inside a label tag , what should have done is to map and return label with each input , the problem was so crazy ,that I couldn't delete the last element what ever I do , so keep in mind from such a silly bug
@Coding Comics I discovered a simple solution: by storing the input value in local storage, the input field will retain its value even after the page is refreshed. This method has worked for me.
This is actually really cool. I was stuck trying to figure out a good way to delete an element from my list until I found this video. I did not know you could pass a unique identifier to a particular object of the map function. Thank you very much.
This is actually really great! It would be helpful if you also show how to add a text field with default information already inside it as well. But great video! I hope you continue making more!
thank you bhai bahut parasan kiya tha dynamic buttons me
I will try and let you know
thank u so much nice and simple explanation :)
Great
Exactly what I needed
Thank you! This solved my problem.
Hello i stuck with this can we connect some way . Many methods i tried still last index is deleting instead of selected index. Please revert
I provided the GitHub link in the description. Take a look at the code.
Awesome exatly what I needed
Bro can you make this.
Table
1)Every table row has a checkbox.
2) when you click on check box delete button will appear when you click on button hole row will delete
3) delete all button also there on top of table.
Yes. I will make video
@@codingcomics maybe in the same video you could show how to handle multiple fields with multiple values to be added to array(array of objects)?
Video link ruclips.net/video/-TJNe7DFLHY/видео.html
const [formData, setFormData] = useState({
sapno: "",
sapimage: "",
pits: [{ pitno: "", pitimages: [] ,url:''}],
});
with this being our form structure, the pit number and url are being deleted but the image of the last input index is being deleted and not respective to the pit number and url. please help us with this
I think the correct index is passing for the pit number and url. The same index is not passing in the image. So maintain in a separate state and use the State.
Maybe this will work
@@codingcomics could you give your email id I will share actually what happening
Beautiful✨❤
I had a small problem while returning the Input and button , I was map inside a label tag , what should have done is to map and return label with each input , the problem was so crazy ,that I couldn't delete the last element what ever I do
, so keep in mind from such a silly bug
Thanks for your efforts. I have a question. In this structure how can I make the first line appear by default?
const [val,setVal]=useState([' ']);
add empty string in the useState
hello
1.Initialize let val = 0 in one variable like this
.2. Add condition inside add button
If (val
Try this
I can't use it to my code , thank you for the reply
Why. Tell me the issue. I try to give solution
great one ,
but I got small bug , I can not delete the last input field
it works fine now , I don't know why yesterday why it was behaving like this
Amazing 🔥
How could I change the useState for Basic JavaScript?
You can change Usestate to const value = []
@@codingcomics Thanks ❤️ Subscribed and like
how can i edit the test on double click
If you want to perform an edit, you need to set all the data in the setVal.
How can I do that... Can you send me an example... Or a video pls
After refreshing the page all the input field getting removed, any solution for this, Thanks for this video BTW :)
I will try and let you know
@@codingcomics Thank you so much 🫡
@Coding Comics I discovered a simple solution: by storing the input value in local storage, the input field will retain its value even after the page is refreshed. This method has worked for me.
Yes.
Thank you
working thanks