Enable disable all buttons of html form using Jquery

To enable disable all the buttons of html form needs to write lots of code in JavaScript. In JavaScript first we need to find all input elements which having input type submit and store it in array. After storing elements in array needs to loop that array and disable or enable element one by one. Instead of writing lots of code we can use JQuery one line code as follows

$('input[type=submit']).attr('disabled',true);

The above JQuery code will disable all input elements which having type submit.

Happy coding...............

Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete

Post a Comment

Popular posts from this blog

Restore the lost focus of Auto post back controls in asp.net update Panel control

Disable backspace key using Jquery

Angular User Session Timeout example step by step

Add Comma automatically while entering amounts in textbox using Javascript

Implement Logging in CSV file using Nlog in .net core MVC application- part 2

Implement Nlog in .Net core MVC application part 1

Clone a generic list in C# using extension method

Send bulk Email in asp.net using excel file

Devexpress Datebox date formatting in angular 6 with example