Home Answers Viewqa HTML disable and enable the submit buttons

 
 


dharani
disable and enable the submit buttons
1 Answer(s)      2 years and 2 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

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 Pages:
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
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 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
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
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
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
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 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
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
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
enable users to enter names - Java Beginners
enable users to enter names  this is the code for tic tac toe game, i..."); private JButton buttons[] = new JButton[9]; private int count, xWins, oWins = 0...)); window.setLocationRelativeTo(null); for(int i=0; i<=8; i++){ buttons[i] = new JButton
Struts application two submit button
Struts application two submit button  Hai, i'm new in struts...; </li> <li class="buttons"> <html:submit tabindex="6" styleClass="btTxt"> <bean
understanding buttons :JSP random no program
understanding buttons :JSP random no program  I hav java random... random no between 100 and 200 on loading and on clicking submit button it ives... "no is greater" please help me to understand buttons .thank you java code for random
enable hyperlink
enable hyperlink  How to enable hyperlink
Multiple submit nuttons in single xhtml form - Java Server Faces Questions
Multiple submit nuttons in single xhtml form  Hi, I am facing problem in my JSF application, where in single page , we have two submit buttons... this, and how can i make the particular submit button is applicable to a particular
Radio Buttons in DB Very Urgent - JSP-Servlet
Radio Buttons in DB Very Urgent  Respected Sir/Madam, I am... in the database.Here I need Radio Buttons added dynamically for each Row. When I click the corresponding Radio Button and Submit,The Emp ID and Emp Name must
JTree Multiple Selection
Enable and Disable Multiple Selections in a JTree Component       In this section, you will learn how to enable and disable the multiple selections in a JTree
WRITE A CODE IN STRUTS ACTION CLASS FOR CHECK BOXES AND RADIO BUTTONS - Struts
for check boxes and radio buttons and for submit buttons. i have a jsp page which contains check boxes,radio buttons.and when i click submit button the related
PHP HTML Form Submit Button
type. This Name attributes of the submit buttons comes very handy at the time...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
submit a form
submit a form  How can we submit a form without a submit button
inserting data from radio buttons to database - JSP-Servlet
inserting data from radio buttons to database  hi, my problem... of radio buttons. the feedback.jsp should look like same as follows: Please...? Poor Average Good SUBMIT FEEDBACK(submit
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
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
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
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
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
need help for writting code in struts action class for check boxes and radio buttons - Struts
buttons and for submit buttons. i have a jsp page which contains check boxes,radio buttons.and when i click submit button the related check boxe values and radio
jsp and ajax
jsp and ajax  how to enable or disable textbox using radio buttons by using jsp and ajax
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
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

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.