Disable switch and lifting form

Sometimes one is enough form, a form already has done a lot of features come out, specifically to see how to write it.
I am here to look at specific to what you want to achieve.
Forms disabled and lifted
Here Insert Picture Description
the outset of this form is not part of the case is the case of the disabled can add data, and then the next one is out of the query data into a form to fill out and then disable these input labels
where you can clearly see these Input label is disabled and out of there data.
Then click on the Edit button is lifted this input
Here Insert Picture Description
When you click the Modify button to ban this form of input labels and can pop up the save button
Here Insert Picture Description
here Function so the next step is the implementation code, first out of this is to disable the pop-up modal box backfill the data here and then disable input tag out this form, and here I wrote only this input is disabled only
after filling out the data back to the first is to get all the input label this form below

var Inp = document.getElementById ( "formHouse") getElementsByTagName ( "input");. // tag form below Input

After obtaining the input to the label is to give him the cycle again and give him the disabled This property assignment.
The following code, the code here is to disable all out Input labels

for (var i = 0; i <Inp.length; i++) {
Inp[i].disabled = “disabled”;
}

After completion disable input label is to disable the drop-down box, because it is part of the drop-down box select the label to spend, then get to select the tab for his disabled this property assignment.
Code below
var Sel = document.getElementById ( "formHouse") the getElementsByTagName ( "SELECT");.
For (var I = 0; I <Sel.length; I ++) {
Sel [I] .disabled = "Disabled";
}
and to the save button to hide is to get to the button and then give him a display none of it, I do not write this code.

Next to realize the function was simply to click on this button to modify the inside of the property disabled input tag value assigned to fill an empty position on it, the code is as follows

var Inp = document.getElementById(“formHouse”).getElementsByTagName(“input”);
for (var i = 0; i < Inp.length; i++) {
Inp[i].disabled = “”;
}

Guess you like

Origin blog.csdn.net/weixin_44486126/article/details/91359870