jquery - Disabling text boxes on submit and enabling on reset -


Using the Zebbri, the text box needs to be submitted when the text is submitted and clicking on the text button, the text The value should be clear in the box and enabled.

Code:

  & lt; Table width = "75%" & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; H: output label value = "actual card number" & gt; & Lt; / H: outputLabel & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; H: Output Label value = "hidden" style = "font: 13px / 15px aerial, non-serif! Important;" & Gt; & Lt; / H: outputLabel & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; H: Input text id = "actual card" style class = "input-lesson-bx" & gt; & Lt; / H: inputText> & Lt; / TD & gt; & Lt; TD & gt; & Lt; H: Input text = "pseudo-card" style class = "input-text-bx" & gt; & Lt; / H: inputText> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; / TR & gt; & Lt; Tr class = "field" & gt; & Lt; TD & gt; & Lt; H: command button style class = "input-all-btn" value = "submit" & gt; & Lt; / H: CommandButton & gt; & Lt; / TD & gt; & Lt; Td align = "center" & gt; & Lt; H: command button style class = "input-all-btn" value = "clear" & gt; & Lt; / H: CommandButton & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; / TR & gt; & Lt; / Table & gt;    

The following codes will behave as necessary.

  & lt; Script & gt; $ (Document) .ready (function () {$ ("[value = 'submit']) Click (function (event) {// code submit (" .input-text-bx "). Attr (" Disable "," disabled "); // Disable all text fields. Event.preventDefault ();}) $ $ (" [value = 'clear'] "). Click (function (event) {// code Remove $ (".input-text-bx"). RemoveAttry ("disabled"); // Enable all text fields. $ (".input-text-bx"). Attr ("value", ""); // Clear all text fields. Event.preventDefault ();});}); & lt; / scripts & gt;    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -