Home Answers Viewqa JSP-Servlet JSP Text Box properties.

 
 


Kiran
JSP Text Box properties.
2 Answer(s)      2 years and 11 months ago
Posted in : JSP-Servlet

How do I restrict a text box created in JSP page only for numbers..

example: I have a function something like this in actionscript
UserID_txt.restrict = "0-9abc^d-zA-Z~!@#$%^&*()+_-'.,";

Do i have any such in JSP. please let me know how to do it..
View Answers

June 12, 2010 at 10:56 AM


Hi Friend,

Try the following code:

<html>
<script>
function isNumber(){
if(/^-?\d+(\.\d+)?$/.test(form.number.value)){
return true;
}
alert("Invalid Number!Only 0-9 digits are allowed");
document.form.number.value="";
return false;
}
</script>
<form name="form">
Enter Number:<input type="text" name="number">
<input type="button" onclick="isNumber();" value="Check">
</form>
</html>

Thanks

Thanks

April 19, 2013 at 4:29 AM


thnx









Related Pages:
JSP Text Box properties. - JSP-Servlet
JSP Text Box properties.  How do I restrict a text box created in JSP page only for numbers.. example: I have a function something like... any such in JSP. please let me know how to do it..  Hi Friend, Try
select box and text box validations
select box and text box validations  hi, any one please tell me how to set validations for select box and text boxes using bean classes? thank you   Please visit the following link: http://www.roseindia.net/jsp/user
Auto Complete Text Box - JSP-Servlet
Auto Complete Text Box  Please help me in Aotocomplete text box code. I m a java programmer. I m working on jsp tech. please give me the code for Autocomplete text box in which the values will generate from database table
Automatically display in text box - JSP-Servlet
Automatically display in text box  Dear Deepak Sir, When i enter some text in text box.That corresponding value in database,the value display in another text box using ajax. Thanks & Regards, VijayaBabu.M
auto complete text box - Ajax
auto complete text box  How to create auto complete text box in jsp using ajax technology ? plz giv me steps wise code
Auto Complete Text Box - JSP-Servlet
Auto Complete Text Box - JSP-Servlet  Auto Complete Text Box Please help me in Aotocomplete text box code. I m a java programmer. I m working on jsp tech. please give me the code for Autocomplete text box in which the values
To display suggestions in a text box - Ajax
the Ajax : Some steps to be memeber : 1)Create a text box on the JSP Page..., to get the suggestions i mean when i enter the alphabet in a text box(For ex:'A'), the names that starts from 'A' have to display in the text box
populating text box using jsp code
populating text box using jsp code  Sir, How to populate related values in a text box after selecting value from drop down list using JSP and mysql...].text; window.location.replace("http://localhost:8080/examples/jsp
To Retain the values entered in the text box after submit in jsp page
To Retain the values entered in the text box after submit in jsp page   i am working on a jsp pge which has many text boxes and one dynamic drop down. The functionality is when user enters comma separated values in those text
How to get data from DB in to Text box by using Jsp & Ajax
How to get data from DB in to Text box by using Jsp & Ajax   I want to get the data from database in to text box in a jsp page by using Ajax. If I enter the letter A in the textbox it should show only those values which starts
display diffrence between two dates in a text box - JSP-Servlet
the days in another text box when i click inside that test box.lease help me...display diffrence between two dates in a text box  i have these set of codes // String di=request.getParameter("timestamp2"); String d2
input type dialog box take text and search a list and focus that text - JSP-Servlet
input type dialog box take text and search a list and focus that text  i have a button..when i press it will prompt a dialog box with a text box... then it will search a list which contains data in the same page and if found
use properties file to connect to the database in jsp..
use properties file to connect to the database in jsp..  How to use properties file to connect jsp code with database ..........   Here is a jsp code that connects to database using properties file. <%@page import
I am getting Undefined in Text Box Very Urgent - JSP-Servlet
I am getting Undefined in Text Box Very Urgent  Respected Sir/Madam... the value "Undefined" in Emp ID text box which is present in the main page.. Here's... application. Read for more information. http://www.roseindia.net/jsp/popup-window
how to display data from mysql table in text box using jsp??
how to display data from mysql table in text box using jsp??  <... at line: 113 in the jsp file: /Cat1.jsp The local variable v_RGPC may not have...="row">Reference GPC</th> 113: <td><input type="text" name
To get the value of more than one text box in an HTML page to a jsp page - JSP-Interview Questions
To get the value of more than one text box in an HTML page to a jsp page  An html file has a text box as To get the value of this text box in a JSP... file has a text box as To get the value of this text box in a JSP file
Text box Checking
Text box Checking  I want to Write only the word A-Z in a text box What is the code
two text box problem
two text box problem  i have two text box in two different pages and same variable use in two text box when enter value in first text box it's reflection show in second text box , how i reduce it in jsf ?   Hi Friend
form text box connection with mysql database feild - JDBC
form text box connection with mysql database feild  Respected Sir, What is the coding to connect a form text box field with mysql database table.../jsp/prepared-statement-query.shtml http://www.roseindia.net/jsp/submit-comments
retrieve value from db in text box + calendar implementation.
retrieve value from db in text box + calendar implementation.  I... there is already a text box..Now i want to get the value retrieved from database in that text field how can i do it... Please help...   Please visit
jsp list box - Java Beginners
jsp list box  I have two list boxs. the values for the first list box is retrieved from the mysql database. I want to fill the second list box... = document.getElementById("country").options[cid].text window.location.replace
java script text box
will click submit button the text should be submitted(it shows the value in alert). i also want the text box should generate in front of NEW button(next/prev...java script text box  hi, I created a button when i click
add text box and select list dynamically and get its value to store it into database using jsp request parameter
add text box and select list dynamically and get its value to store it into database using jsp request parameter  its very helpful when you have only... added select box also into next jsp page plz reply me as early as posssible
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
Display current date in text box in JSP using javascript
Display current date in text box in JSP using javascript In this section you will learn how to display current date in text box using JavaScript.For...; Today's Date is: <input type="text" id="datetext"> <
enable text box and label on selection
enable text box and label on selection  hello, Please tell me how to enable label and text box on selection of drop down list box. in drop down list box all values come from database. please reply
Text box control--keypress event
Text box control--keypress event  In my form have a text box...My requirement is... when is type characters in that box... before typing the 3rd character the space should come automatically or programmatically...the sturucture
reading data from a text box with the same name using servlets - JSP-Servlet
reading data from a text box with the same name using servlets  ... like a= b= c= using servlet i want to print all the values from each text box? is it possible.this question i faced in an interview. kindly reply
Drag a Text Box into dynamic positions
Drag a Text Box into dynamic positions  Plz can anyone tell how can i drag a text box using mouse or arrow keys... Im doing a accounts projects and i need this feature for cheque configuration
sir plz help in design a jsp page whichis as follow username [_____] select [__>]password [_____] after selection then onlypassword text box is visible
sir plz help in design a jsp page   sir plz help in design a jsp page which is as follow username [ _ ] select [ > ] password [ _ ] after selection then only password text box is visible
How to retrieve data by using combo box value in jsp? - JSP-Servlet
How to retrieve data by using combo box value in jsp?  For example, In Employee.jsp form, When i click employee id value in combo box ,the related employee name will be displayed in text field
dependent drop down box - JSP-Servlet
the solution how to extract data from dependent drop down box with page refresh...; var val = document.getElementById("book").options[cid].text; window.location.replace("http://localhost:8080/examples/jsp/dependentDropdown.jsp?id="+cid+"&&value
Name Display in alert box - JSP-Servlet
......... when i enter some value in text that value is already in database display the alert box but the value is not in data base alert box is not display... ){ if( xmlHttp.status==200 ) { document.getElementById(?text?).innerHTML
Dynamic select box - Ajax
in the other select box automatically.. The city details must be extracted from... used the tables country(country_id(Number),countryname(Text)) and city(cityid(Number),country_id(Text),cityname(Text)) Try the following code
reading dropdown values from properties file in jsp
reading dropdown values from properties file in jsp  reading dropdown values from properties file in jsp
Properties file in Java
Properties file in Java       In this section, you will know about the properties file. The properties file is a simple text file. Properties file contains keys and values
combo box - JSP-Servlet
combo box  how to get a combo box in jsp page which allows editing as well as list box
how to create a text box using awt
how to create a text box using awt  give an example how creat multi buttons & text boxes
Java Bean Properties
Java Bean Properties  What are the properties of a normal java Bean(Not EJB)   HI Friend, Please visit here: http://www.roseindia.net/jsp/usingbeansinjsp.shtml Thanks
J2ME Text Box Example
J2ME Text Box Example       This application illustrates how to create the text box using TextBox class. The TextBox class is a Screen that allows the user to enter and edit text
Struts2.2.1 hello world annotations Example using Properties
Struts2.2.1  hello world annotations Example using Properties  ... properties.  In this example we use the /result where we put the result... using @Action and @Result- First we create a JSP file named index.jsp
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... is created. and i want to do that when i enter the text input in text box and when i... box in SOP). i also want the text box should generate in front of NEW button
Create Box in Excel Sheet Using JSP
create box in excel sheet using jsp  ... a box  and then after we pass the sting in the box. Code description... java.lang.Comparable.The  rich text unicode string and  can have fonts applied
How to assign a default value to text box in netbeans
How to assign a default value to text box in netbeans  I have a java application,and i want to assign a default variable to the textbox
How to retrieve data by using combo box value in jsp? - JSP-Servlet
How to retrieve data by using combo box value in jsp?  Hi Friends, When i click combobox value in jsp form page, it will diplay...... For Example, in Student.jsp... when i click student id in combo box
how to display webservice response in a text box
how to display webservice response in a text box  Hallo, i have created a webservice and when i sended request to my webservice its sending proper response . the point is how to dispaly the response values in a text box usinj
How to write .properties file from jsp
it in my jsp but Iam unble to modify/write the .properties file and Iam not getting... to implement/write .properties file from jsp. Regards, Venkatesh Gurram...How to write .properties file from jsp  Hi i new to java i stuck here
msg box in jsp
msg box in jsp  i need the source code to display the msgbox in jsp....but one condition is,i need to use it in the current page itself...now i use the message box means it prints it into another page...i need to resolve it plz
check box in jsp
check box in jsp  hey guys i am working on a web based project using jsp. In my project 1 am having 9 check boxes in 3 rows in the same form. I want to select 1 check box from each row and also i want to avoid many check box
Properties file in Java
Properties file in Java       Properties file in Java In this section, you will know about the properties file. The properties file is a simple text file. Properties

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.