Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa HTML disable and enable the submit buttons
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


dharani
disable and enable the submit buttons
1 Answer(s)      3 years and 9 months ago
Posted in : HTML


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


Advertisement
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
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
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
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   ... number. To enable or disable any tab you can use the setEnabledAt(int index... and APIs that you can use in your program to enable or disable the tabs. addTab
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
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
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
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
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
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
enable hyperlink
enable hyperlink  How to enable hyperlink
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.   For all submit buttons, via JQuery, it'd
submit a form
submit a form  How can we submit a form without a submit button
uikeyboard disable return key
uikeyboard disable return key  uikeyboard - hot to disable return key
How to disable an HTML object?
How to disable an HTML object?  How to disable an HTML object
Disable UITableView Scrolling
Disable UITableView Scrolling   How to disable the UITableView Scrolling either programmatically or in XIB
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
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" /> <
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
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
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
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
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
how to enable nszombie in xcode 4
how to enable nszombie in xcode 4  how to enable nszombie in xcode 4
 

 

 

DMCA.com