technomark.in
Hot News

$(this) Selector And Children / Find In jQuery

Detect An Undefined Object Property In JavaScript

Rotate And Save Video Using VLC Media Player

Capitalize The First Letter Of String In JavaScript

Convert Any Files To Any Format Using VLC Media Player

Asp.Net AngularJS WCF IIS
DataBase Jquery Bikes Random
HomeContact Us Watch Our YouTube Channel ..........Blog Spot..........

Technomark.in

How To Logout From All Devices In Skype

Technomark.in

How To Embed Google Map In Your Code

Technomark.in

How To Install IIS (Internet Information Services) On Windows

Technomark.in

Enable Directory Browsing In IIS

View All


How to Enable Or Disable Submit Button Using Jquery


Enable/Disable Submit Button Using Jquery

> We can disable or enable any form element like button using Jquery prop or attr.
> If Jquery version is 1.6 or above, we can use Jquery prop.
> If Jquery version is 1.5 and below, we can use Jquery attr.
> Lets consider one example here.
> Suppose we have a TextBox and Button as shown below.

How to Enable Or Disable Submit Button Using Jquery, Enable Submit Button Using Jquery, Disable Submit Button Using Jquery, How to Enable Submit Button Using Jquery, How to Disable Submit Button Using Jquery, Disable Submit Button, Enable Submit Button, Jquery

Enable/Disable Submit Button Using Jquery - Jquery prop ver : 1.6+

> Initially, when there is nothing on the textbox, the Button will be disabled.

How to Enable Or Disable Submit Button Using Jquery, Enable Submit Button Using Jquery, Disable Submit Button Using Jquery, How to Enable Submit Button Using Jquery, How to Disable Submit Button Using Jquery, Disable Submit Button, Enable Submit Button, Jquery

> When we type anything on the textbox, the button should be enabled.

How to Enable Or Disable Submit Button Using Jquery, Enable Submit Button Using Jquery, Disable Submit Button Using Jquery, How to Enable Submit Button Using Jquery, How to Disable Submit Button Using Jquery, Disable Submit Button, Enable Submit Button, Jquery

> So on the KeyUp event of Textbox, we can apply following logic in Jquery.

$(function () {
    $('#btnInput').prop('disabled', true);
    $('#txtInput').keyup(function () {
        if ($(this).val() != '') {
            $('#btnInput').prop('disabled', false);
         }
    });
})



Enable/Disable Submit Button Using Jquery - Jquery attr

> If Jquery version is 1.5 and below, we can use Jquery attr.

$(function () {
    $('#btnInput').attr('disabled', 'disabled');
    $('#txtInput').keyup(function () {
        if ($(this).val() != '') {
            $('#btnInput').removeAttr('disabled');
         }
    });
})



Watch Video of this Content on Video Steaming


Post Your Comment

Name *


Email *


Comment * Please provide all three fields for posting Comment




Comments

f:
s

Technomark.in

Book Train Tickets on IRCTC Quickly During Tatkal Period

Technomark.in

Before You Copy Any Image From Internet

View All

Privacy StatementDisclaimerSitemap