javascript - Prevent default action on all inputs -
i creating html form designer - user can place input elements in grid on page saved database , finished form useable other users.
now of works already, i've hit trivial, yet annoying issue - since need use actual input elements in code layout appears correctly during design, user can type in textfields, change values of checkboxes etc., none of saved, it's quite confusing. form designer allows elements enabled/disabled, disabling elements on page worse.
my question is: can disable default actions of input elements (writing text after clicking on text field, checking/unchecking checkboxes, kind of stuff) in simple manner? far i've tried binding various events jquery's preventdefault, no success. know react stuff keypresses , undo them, seems needlessly complicated.
depending on kind of inputs have give the readonly
attribute. either directly on html or jquery $("input").prop("readonly",true);
Comments
Post a Comment