Disabling submit button using jQuery

Hello Sir

I want to know - is there any way or approach to disable client side form's "Submit" button.

Please give code also.

View Answers

December 11, 2010 at 12:59 PM

For all submit buttons, via JQuery, it'd be:

$('input[type=submit]').click(function() { this.disabled = true; });

Or it might be more useful to do so on form submission:

$('form').submit(function() {
    $('input[type=submit]', this).attr("disabled","disabled");
});

But I think we could give a better answer to your question if we knew a bit more about the context.









Related Tutorials/Questions & Answers:
Disabling submit button using jQuery
Disabling submit button using jQuery  Hello Sir I want to know - is there any way or approach to disable client side form's "Submit" button. Please give code also.ADS_TO_REPLACE_1   For all submit buttons, via JQuery
JQuery-Disabling element in JQuery.
JQuery-Disabling element in JQuery.   How can we enable/disable an element in JQuery
Advertisements
submit button
submit button  <p>hi I am trying to insert record in database using hibernate in JSP(Netbeans). When I click insert button it should go...; <input type="submit" value="Insert" name="login" /> <
disabling back button
disabling back button  hi, i am trying to make an application and i... press back button i again reach to the back page ie. authentication page so if any one can help me how to disable this button
disabling the browser's back button
disabling the browser's back button  I have following requirement, After submitting the form, user should not navigate to the previous page. I have tried with onbeforeunload(), but it is not working properly. Please help me
Disabling the back button in all the browsers
Disabling the back button in all the browsers  I have a requirement like this, I have to disable back button of all the browsers(It should support all the browsers). Can u plz help me
how to disable submit button in jsp using servlet when some condition is satisfied
how to disable submit button in jsp using servlet when some condition is satisfied  how to disable submit button in jsp using servlet when some condition is satisfied
JSP Submit Button
JSP Submit Button  Sir, I have a JSP page with 2 Submit button, both calls doPost method of same servlet. If I click any submit button the text box value get refreshed and set to null or blank, that should not happen. Plz help
image on submit button
image on submit button  i need to set an image on submit button. In javascript we can create a button like.. <a href="javascript:;" class="button...: transparent; cursor: pointer; or input[type=submit] { background: transparent
create text box by clicking button and submittong text in text box using submit
create text box by clicking button and submittong text in text box using submit  Hi, I created a button when i click on button new textbox... will click submit button the text should be submitted(it shows the value in text
Submit button to MySQL database?
Submit button to MySQL database?  Need help linking html code...="text" name="Level" /> </form> <td><input type="submit" name="Submit" value="Submit"></td> </body> </html> <
Submit button to MySQL database?
Submit button to MySQL database?  Need help linking html code...="text" name="Level" /> </form> <td><input type="submit" name="Submit" value="Submit"></td> </body> </html> <
jQuery 'submit' form event
jQuery 'submit' form event In this tutorial, we will discuss about the  'submit' form event of jQuery. In this example , In this example a text box and a button is given, when we hit the button, it will check
How can we submit a form without a submit button?
How can we submit a form without a submit button?  How can we submit a form without a submit button
jquery button click
jquery button click  jquery button click - I have created a button... to create a button event in JQuery. You can edit it as per your requirement. In Header...(){ alert("button clicked"); }); }); </script> JQuery HTML
enabling and disabling a hyperlinks using javascript only
enabling and disabling a hyperlinks using javascript only  Hi! can anyone help in enabling and disabling hyperlinks?. Question1: There is a frame set...;td><b>ListOfOwners </b></td> <td><input type="button
Struts application two submit button
;/html> Here am using two submit button one is login and another one is new...Struts application two submit button  Hai, i'm new in struts...;html:submit tabindex="6" styleClass="btTxt"> <bean
Enabling and Disabling Button In JSF
Enabling and Disabling Button In JSF  ...; In this tutorial enabling and disabling a button on different conditions has been explained. A button can be disabled setting "disabled"
On Click on Submit Button Display Data on Orderlist
On Click on Submit Button Display Data on Orderlist  How can retreive data from database on orderlist on Click on submit Button of same page
back button in jquery
back button in jquery  Creating a back button in JQuery   <script src="/javascript/jquery.min.js"></script> <script type="text/javascript">     $(document).bind("mobileinit", function(){     Â
jQuery UI Widget : Button
jQuery UI Widget : Button       jQuery UI Widget : Button Button enhances standard form elements like button, input of type submit or reset
Show text field & check input using jQuery
Show text field & check input using jQuery In this tutorial, we... input using jQuery. In the below example, aIn this tutorial, we will discuss about how to display 'text field' by a button click & check input using
Form validation using jQuery plug in & JSP
Form validation using jQuery plug in & JSP In this tutorial, we will discuss about form validation using jQuery plug in & display of submit content... name, email, url, content is validated using jQuery plug in. After successful
Click On Images of Submit Button Perform Action
Click On Images of Submit Button Perform Action  I have login page in which insert of submit button i used image. Therefor on Click of image i have to validate form , link with database and goto the next page
enabling and disabling a hyperlinks using javascript only
enabling and disabling a hyperlinks using javascript only  Hi! Anyone can help in enabling and disabling a hyperlinks?. Question1: There is a frame.... Question 2: Is there a solution using Java script only to achieve the problem
JQuery-check/uncheck radio button in jQuery
JQuery-check/uncheck radio button in jQuery  Hi Sir, I want to know how can i check/uncheck input or radio button?   You can check/uncheck radio button by setting the 'checked' attribute to true or false as follows
how to disable submit button after login in jsp
how to disable submit button after login in jsp  Hi, I have... on the back button in browser it stars displaying login page. How to prevent this? how to disable submit button after login in jsp? Thanks   Hi, You can
How to save form fields into the MySql Database without submit button in jsp?
How to save form fields into the MySql Database without submit button in jsp?  I want to store user inputs into the database using javasccript or ajax or jqury but without submit button. Form Contains three fields
Html form validation using jquery
Html form validation using jquery  Hi i am using form with html. Form elements like textbox, radio,checkbox,listbox i was used now how to validate the elements using submit jquery option
Show text by button click using jQuery
Show text by button click using jQuery In this tutorial, we will discuss about hide/show text by clicking on button. In the below example, there are two buttons : hide and show .The "hide " button is used to hide text
Moving Div by button click using animate effect
Moving Div by button click using animate effect In this tutorial , we will discuss how to move 'div' left-right by button click using jQuery. In this example , 'div' is moving left / right by left / right button click
PHP HTML Form Submit Button
; /> Instead of using submit in input type, we can also use button image...Topic : HTML FORM SUBMIT BUTTON Part - 4 The another part which is important to covered that is Submit button. If you are following all the previous parts
Vertical news slider using jquery
Vertical news slider using jquery  how to creatw vertical news slider using jquery Sorry for wrong category but i cant get my jquery category
storing details in database on clicking submit button - JSP-Servlet
storing details in database on clicking submit button  I am using JSP in NetBeans and have developed an application form which has fileds naming... database on clicking submit button. I am unable to do this.Can u tell me how to code
Show Limited Data Using jquery
Show Limited Data Using jquery  How to show limited results in JQuery... it using JQuery?   See the JQuery example to show the limited fetch results in JQuery. var comments = $('.description_text').size(); if (comments >
Submit comments in database when user clicks on submit button
Submit comments in database when user clicks on submit button... database when user clicks the submit button of the page. Create a database: First... be integer number then click submit button. If all the values are submitted
Form validation Using Jquery Plugin
Form validation Using Jquery Plugin  Hello sir I want to implement form validation using JQuery Plug-in. My code is : <html> <style type...; } .submit { margin-left: 125px; margin-top: 10px;} .label { display
Facing Problem with submit and cancel button in same page - Struts
Facing Problem with submit and cancel button in same page  Hi, can u please help me out.I have placed submit and cancel button in the jsp page but i am unable to know how to write the form and action classes   Hi
HTML form validation using jquery
HTML form validation using jquery  Is there any way for validating html elements common under a class by giving its class name in jquery validation code..that means validating all elements by using its class name if those
Using the jQuery event object
Using the jQuery event object       Using the jQuery event object JQuery... to these standards, this system normalize the event object. jQuery. Event
Using the jQuery Transform plug-in(XSLT)
Using the jQuery Transform plug-in(XSLT)       Using the jQuery Transform plug-in(XSLT... Language Transformations ). The jQuery Plugin we are using
application using AJAX and JQuery and also use JSP
application using AJAX and JQuery and also use JSP   i need create an application using AJAX and JQuery and also use JSP
jQuery Button
What is JQuery Button ? A button is a user interface that provides the user... etc. Getting Started with jQuery Animated Button: In jQuery we can make buttons... jQuery animated button. Step 1: In the first step we make css to create the button
creation button using objective c
creation button using objective c  creation button using objective c
validate radio button using javascript
validate radio button using javascript  validate radio button using javascript
Find Browser & it's version using jQuery
Find Browser & it's version using jQuery  Hi sir I heard that JQuery have some method which can be used to find the Browser name & its version. I need the code which checks the browser and if it is "Mozilla", it will show
How to write a search functionality using javascript/jquery
How to write a search functionality using javascript/jquery   How to write a search functionality using javascript/jquery for ex: im searching "s" names it wil display "s" names
is it possible to add a button inside an autocomplete jquery ui plugin?
is it possible to add a button inside an autocomplete jquery ui plugin?  is it possible to add a button inside an autocomplete jquery ui plugin? My... a button that will open a jquery modal form, that the user can enter the desired data
Using the QUnit to test jQuery application
Using the QUnit to test jQuery application       Using the QUnit to test jQuery application Using Qunit , testing of JQuery become very easy and efficient
Crop image Using JQuery, servlet or JSP.
Crop image Using JQuery, servlet or JSP.  Hi sir I need the code of Cropping image using JQuery with the help of servlet or JSP. I need both the code Client side as well as of server side. Please Help me