简体   繁体   English

如何添加一个按钮,单击该按钮会在反应中转换我所有可编辑的文本字段?

[英]How do I add a button that when clicked converts all my text field editable in react?

Here is an example of what I am trying to do:这是我正在尝试做的一个例子:

enter image description here The basic idea is as soon as I click the edit button all the text field turn into a input box when you can change the text and click enter to save.在此处输入图像描述基本的想法是,当我单击编辑按钮时,所有文本字段都会变成一个输入框,此时您可以更改文本并单击 Enter 保存。

您可以使用input元素并在单击按钮时切换disabled属性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使我的 td 中的所有输入对于单击编辑按钮的行都是可编辑的 - How can I make all the inputs inside my td's editable for the row the edit button was clicked on 如何使我的搜索字段显示一些文本,并使其在单击时消失 - How do I make my Search Field show some text and make it disappear when it's clicked 是否可以在文本字段中添加“保存” /“提交”按钮,以便在单击按钮时将文本保存在该字段中? - Can I add a “Save” / “Submit” button to a textfield so the text saves in the field when the button is clicked? 如何在文本输入字段中添加“搜索”按钮? - How do I add a “search” button in a text input field? 如何使可编辑的DIV看起来像文本字段? - How do I make an editable DIV look like a text field? 如何为“ contenteditable”可编辑字段添加取消按钮? - How to add a cancel button for 'contenteditable' editable field? 单击HTML中的编辑按钮时如何使表(文本)中的字段可编辑 - How to make the fields in the table(text) editable when clicked on edit button in HTML 如何在图像上添加可编辑的文本字段? - How do I add editable text fields on an image? 基于单选按钮单击时如何启用文本字段 - How to enable text field when clicked based on radio button 单击按钮时,如何取消我的按钮:css 中的 hover? - How do I cancel my button:hover in css when a button is clicked?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM