disable and enable the submit buttons

disable and enable the submit buttons

i have two summit button in my form. one is disabled and other is navigating to the other page. after 3 submissions of the submit button the disabled one must be enabled and the enabled one must be disabled..

pls help me

View Answers

March 30, 2011 at 1:20 PM

<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <script type="text/javascript">
   function disable(buttonid){
    var button1_name;
    var button2_name;
    if(buttonid=="button1"){
     button1_name=document.getElementById('button1').name;
     button1_name++;
     document.getElementById('button1').name=button1_name;
     alert("Click Button 1 :: "+document.getElementById('button1').name)
    }else{
     button2_name=document.getElementById('button2').name;
     button2_name++;
     document.getElementById('button2').name=button2_name;
     alert("Click Button 2 :: "+document.getElementById('button2').name)
    }
   if(button1_name==3){
     document.getElementById('button1').disabled = true;
     document.getElementById('button2').disabled = false;
     document.getElementById('button1').name=0;
    }
   if(button2_name==3){
     document.getElementById('button2').disabled = true;
     document.getElementById('button1').disabled = false;
     document.getElementById('button2').name=0;
    }
  }
 </script>
 </meta>
</head>
<body>
 <table align="center" >
  <tr>
   <td><input type="button" id="button1" name="0" 
       value="Button 1" onclick="disable(this.id)" /></td>
  </tr>
  <tr>
   <td><input type="button"  id="button2"  name="0" disabled
     value="Button 2" onclick="disable(this.id)" /></td>
  </tr>
 </table>
</body>
</html>









Related Tutorials/Questions & Answers:
disable and enable the submit buttons
disable and enable the submit buttons  i have two summit button in my form. one is disabled and other is navigating to the other page. after 3 submissions of the submit button the disabled one must be enabled and the enabled one
enable disable checkbox in javascript
enable disable checkbox in javascript  How to enable disable checkbox in javascript
Advertisements
enable disable table
enable disable table  hi I have table with 3 columns if i click one column the other 2 column should disable pls can anyboby help me
more Submit buttons in the same form
more Submit buttons in the same form  Can I have two or more Submit buttons in the same form
Task manager enable and disable thru java
Task manager enable and disable thru java  I would like to know, how to enable and disable task manager using java. Kindly, please Let me know
how to make enable/disable textbox in while(rs.next)
how to make enable/disable textbox in while(rs.next)  Hi, I'm trying to enable/disable the textbox in the while loop. It works but when i want to update my data, the data are not updated correctly. When i remove the enable
how to make enable/disable textbox in while(rs.next)
how to make enable/disable textbox in while(rs.next)  Hi, I'm trying to enable/disable the textbox in the while loop. It works but when i want to update my data, the data are not updated correctly. When i remove the enable
Enable and Disable Tab in Java
Enable and Disable Tab in Java   ... name and index number. To enable or disable any tab you can use the setEnabledAt... are some methods and APIs that you can use in your program to enable or disable
how to disable submit button after login in jsp
how to disable submit button after login in jsp  Hi, I have an application and when user logs in welcome page is displayed. When user clicks... to disable submit button after login in jsp? Thanks   Hi, You can
php form having 2 submit buttons
php form having 2 submit buttons  i have a php form and some text boxes.and 2 buttons"approve" and "disapprove". when i click on approve button the data from form should go in mysql database and mail should go to appropiate
how to enable and disable a input type in jsp - JSP-Servlet
how to enable and disable a input type in jsp  how to disable the input type and enable based on some input in the input type   Hi Friend, Try the following code: function function1(){ var n
disable backward and forward buttons of the browsers - JSP-Interview Questions
disable backward and forward buttons of the browsers  Dear, Thanks for your last reply. I want if you help me to disable the backward of forward of the browser by program using javascript or java. Sometimes when i access
Multiple submit buttons in single xhtml form - Java Server Faces Questions
Multiple submit buttons in single xhtml form  Hi all, Here I am attaching the source of the page , which containig two submit buttons. Somebody suggested to keep eaxh button in different form. I am new to JSF, can anyone split
disable backward and forward buttons of the browsers - JSP-Interview Questions
disable backward and forward buttons of the browsers  Dear, Please can you help me : I want to disable backward and forward buttons... with no toolbar and other properties disabled and disable the right click
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 code to enable and disable certain links using jsp code - Java Beginners
Jsp code to enable and disable certain links using jsp code  Hi... have to enable/disable a link.I need a code to do that. Thanks in advance... write the code to disable these links.. Can anyone help me?? its really really
Buttons
Buttons  I have created a web page with radio button group with two radio buttons for accepting the home appliances categories,Kitchen appliances and other appliances.I want to check for the appliance chosen when the required
disable function
disable function  Sir, I have called a java script function when one radio button is checked i want to disable this function when another radio button is checked ,both radio buttons are of same group Please help Thanks in advance
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
submit a form
submit a form  How can we submit a form without a submit button
enable hyperlink
enable hyperlink  How to enable hyperlink
How to disable an HTML object?
How to disable an HTML object?  How to disable an HTML object
uikeyboard disable return key
uikeyboard disable return key  uikeyboard - hot to disable return key
Disable UITableView Scrolling
Disable UITableView Scrolling   How to disable the UITableView Scrolling either programmatically or in XIB
radio buttons
radio buttons  write a program to create an applet button which has a list of radio buttons with titles of various colours.set the background colour... has a list of radio buttons with titles of various colors and a button
disable keyboard in java applet
disable keyboard in java applet  How to disable key board of my client in an java applet embedded in a website while the applet is running.? Plz help
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" /> <
add Buttons in JavaScript
add Buttons in JavaScript  How to add Buttons in JavaScript
uitextfield disable keyboard
uitextfield disable keyboard  How to disable keyboard of UITextView in iPhone SDK application?   There are two ways to disable the keyboard...)]; [self.view addSubview:pv]; return NO; } //or simply disable
buttons in netbeans,java
buttons in netbeans,java  respected sir, i would like to known how to make coding on a button while working on netbeans, so that a new window...="submit" value="open new window" onclick="window.open('xyz.html', 'null', 'width
ModuleNotFoundError: No module named 'buttons'
ModuleNotFoundError: No module named 'buttons'  Hi, My Python... 'buttons' How to remove the ModuleNotFoundError: No module named 'buttons... to install padas library. You can install buttons python with following command
code to disable back button of browser
code to disable back button of browser  code to disable back button of browser
code to disable back button of browser
code to disable back button of browser  code to disable back button of browser
Submit Articles
Submit Articles       Submit Articles at RoseIndia.net and Generate huge traffic and publicity... at RoseIndia.net has become very easy. We welcome all of you to submit your articles
uinavigationcontroller add multiple buttons
uinavigationcontroller add multiple buttons  How to add multiple buttons to the UINavigationController
java buttons - Swing AWT
java buttons  There are 3 buttons in a window....A,B,C.If a user clicks button A ,a clue is given to him leading to button B.After the user clicks both A and B,he clicks C which is a submit button.After this both A and B should
how to disable browser back button
how to disable browser back button  Am doing a web application in that how to disable browser back button using java script
Disable of Combo - JSP-Servlet
Disable of Combo  Hi! Thanks for your fast reply. In my project i am giving grading facility to the user. Once user selected his grade in combo.... That means every user can give grade only at once... so i would like to disable
HTML custom buttons
HTML custom buttons  How can I make a form with custom buttons
3 RADIO BUTTONS
3 RADIO BUTTONS  3 RADIO BUTTONS USING ALSO ONE RADIO CLICKING HOW TO PROCESS OF NEXTPAGE
ModuleNotFoundError: No module named 'pytest-disable'
ModuleNotFoundError: No module named 'pytest-disable'  Hi, My... named 'pytest-disable' How to remove the ModuleNotFoundError: No module named 'pytest-disable' error? Thanks   Hi, In your python
disable the form - JSP-Servlet
disable the form  Hi All, I'm developing a small application. I wrote jsp page in that 8 forms are there.all forms are same but the input values... that particular button disable by using document.formname.buttonname.disable = true
ModuleNotFoundError: No module named 'submit'
ModuleNotFoundError: No module named 'submit'  Hi, My Python... 'submit' How to remove the ModuleNotFoundError: No module named 'submit'... to install padas library. You can install submit python with following command
ModuleNotFoundError: No module named 'enable'
ModuleNotFoundError: No module named 'enable'  Hi, My Python... 'enable' How to remove the ModuleNotFoundError: No module named 'enable'... to install padas library. You can install enable python with following command
URL CODE OF BUTTONS
URL CODE OF BUTTONS   how to create a button tag, i need a details for creating a button tag with url code
enable text box
enable text box  Dear all I would like to enable a textbox by clicking on a button. pleas ehelp me out how can i do this regards JV
Enable Browser's back button
Enable Browser's back button  how to redirect to a home page when browser's back button is pressed in jsp instead of displaying the previous page
Inform user to enable JavaScript
Inform user to enable JavaScript   Hi sir How can we inform user to turn on JavaScript ? Because if we have implemented validation etc with JavaScript , then it will not work. What option we have when this situation occurs
labels,textfields,buttons
labels,textfields,buttons  how to set the labels,textfields,buttons at certain positions such that we can add them without layout managers? my program is to design a login page with image and these labels at exact positions
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

Ads