how to enable and disable a input type in jsp

how to enable and disable a input type in jsp

View Answers

December 23, 2009 at 12:28 PM

Hi Friend,

Try the following code:

<script language="javascript">


function function1(){
var n=document.form.name.value;
if (n.length>=5){
document.form.name.disabled=true;
}
else{
document.form.name.disabled=false;
}
}
</script>
<form name="form">
Enter Name:<input type="text" name="name" onkeypress="function1();">
</form>

Thanks

Ads









Related Tutorials/Questions & Answers:
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
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.../disable function,the data are updated correctly. Is my javascript wrong? How do i
Advertisements
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.../disable function,the data are updated correctly. Is my javascript wrong? How do i
enable disable checkbox in javascript
enable disable checkbox in javascript  How to enable disable checkbox in javascript
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
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
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
Enable and Disable Tab in Java
Enable and Disable Tab in Java       In this section you will learn how to enable... number. To enable or disable any tab you can use the setEnabledAt(int index
How to disable browser back and forward button after logout [in struts2 or jsp]
How to disable browser back and forward button after logout [in struts2 or jsp]  How to disable browser back and forward button after logout [in struts2 or jsp] I am using window.history.forward(); function
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 read the contents in a file which is of input type file
How to read the contents in a file which is of input type file  I have a jsp page wherein i have to passs the file as input and read the contentsn...-data" ACTION="upload"> File to upload: <INPUT TYPE=FILE NAME="upfile"><
How to disable browser back after logout - JSP-Servlet
How to disable browser back after logout  Dear All I created JSP.... Anyone having idea how to disable browser back button after logout, please..."); session.removeAttribute("type"); session.invalidate
How to get the full path location using <input type=file>
How to get the full path location using input type=file  Hi. I have used input type=file> in HTML to select an image. But it selects only the image but not with its full path location. how to do it? Thanks in advance
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
how to save an input to jsp page in a text file?ave an input given b
how to save an input to jsp page in a text file?ave an input given b  how to save the input given by the user in jsp page to a text file
How to disable browser back after logout - JSP-Servlet
How to disable browser back after logout  thanks deepak, i tried but if i am clicking back still i can see my old pages. i copied your code in my logout page. please if you have any other solution, please give me
different type input in java
different type input in java  hiiiii... get input different different type like as DataInputStream,Scanner i want to get source code of these all type of input method. thank   Java Read through DataInputStream: import
Input type select
Input type select  This block of code shows 4 countries even when the size of the SELECT element specified is 2. Why is it so? Select a Country: <select name="country" size="2"> <option name="Australia" value
html input passing to jsp method
html input passing to jsp method  i want code in which jsp method...;input type="text" name=pid onblur="m1()" /> <input type="text" name=pname /> <input type="text" name=pcost /> <input
how to Use jsp:setProperty to set one bean in other bean while to be set bean is of type java.util.List<beantype>
how to Use jsp:setProperty to set one bean in other bean while to be set bean... (a.jsp) containing input fields for all the 3 classes, and action of that jsp...(in Book.java), as its type is List not Chapter. <jsp:setProperty name="book
how to write the coding for converting the database data for example population into any type of graph using jsp and servlets?//
jsp and servlets pls help me out how to write the coding for converting the database data for example population into any type of graph using jsp and servlet...coding for converting the database data  how to write the coding
How to disable task manager using java
How to disable task manager using java  How to disable task manager using java
How to Disable Catch-all Emails on CPanel
How to Disable Catch-all Emails on CPanel  Hi, How to disable catch all emails setting on CPanel? Thanks
how to enable nszombie in xcode 4
how to enable nszombie in xcode 4  how to enable nszombie in xcode 4
HTML5 input attribute, Define the type, alt and image  of input tag.
HTML5 input attribute, Define the type, alt and image  of input tag. Introduction:Here we will introduce you to about the type attribute of input tag... only given type of data. It is most important for input tag. The alt 
How to enable proxy settings in Maven?
Maven 3 Tutorial: How to enable proxy settings in Maven? In this tutorial I will teach you how to enable proxy settings in maven? If your computer is behind... build tools is not able to access the remote repository. To enable the proxy
How to enable second level cache in Hibernate 5?
How to enable second level cache in Hibernate 5?  Hi, I want to enable the secondary level caching in Hibernate 5. How to enable second level cache in Hibernate 5? Thanks
How to enable second level cache in Hibernate 5?
How to enable second level cache in Hibernate 5?  Hi, I want to enable the secondary level caching in Hibernate 5. How to enable second level cache... is not dirty. So, in Hibernate 5 you can enable secondary level caching
How to read user input in C++
How to read user input in C++  How can i get an input from the users in C++?   You can use the standard input "cin" to get the input from user.. For example: int age; cin >> age
How to Type in japanese in java Textfield?
How to Type in japanese in java Textfield?  Hello Sir/madam; Am creating an application in java in which i want to get a japanese String input from user.User needs to type in japanese in the textField.but I dont know how to type
jsp and ajax
jsp and ajax  how to enable or disable textbox using radio buttons by using jsp and ajax

Ads