Dynamically Add and Remove Input Field when Button Clicked in React JS

preview_player
Показать описание
How to add and remove input dynamically when button is clicked and console the value in react js.

#react #dynamicinput #addRemoveDynamicInputButtonClick
Рекомендации по теме
Комментарии
Автор

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.

supernico
Автор

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!

Talgie
Автор

thank u so much nice and simple explanation :)

angularuser
Автор

thank you bhai bahut parasan kiya tha dynamic buttons me

ashishkumar-fgph
Автор

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

dr.slasher
Автор

Thanks for your efforts. I have a question. In this structure how can I make the first line appear by default?

ozsoytalha
Автор

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

dsp_creations
Автор

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

dsp_creations
Автор

great one,
but I got small bug, I can not delete the last input field

dr.slasher
Автор

How could I change the useState for Basic JavaScript?

jakubdrazkowski
Автор

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.

sanketgole
Автор

how can i edit the test on double click

ftcgrod
Автор

hello <<<< how to limit clone field to 5 (means limit field to 5)

SafiyullaMona
Автор

After refreshing the page all the input field getting removed, any solution for this, Thanks for this video BTW :)

faruksardar