validating 1 Answer(s) 3 years and 2 months ago
Posted in : Swing AWT
hi another problem i am facing in swing is that is i have got many textfeilds ex:
Roll No: Name: Address:
so Roll No TextField have to Contains only Numbers. Name TextFields have to contain only Alphabets no special or numbers; soplz help me how can be validated.
View Answers
March 15, 2010 at 1:08 PM
Hi Friend,
Use the following code if you want to validate textfields TRollNo and TName
TRollNo.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { String input=TRollNo.getText(); Pattern p = Pattern.compile("[A-Z,a-z,&%$#@!()*^]"); Matcher m = p.matcher(input); if (m.find()) { JOptionPane.showMessageDialog(null, "Please enter only numbers"); } } }); TName.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { String input=TName.getText(); Pattern p = Pattern.compile("[0-9]"); Matcher m = p.matcher(input); if (m.find()){ JOptionPane.showMessageDialog(null,"Enter only characters A-Z or a-z"); } } });
Thanks
Related Pages:
validating a HTML validating a HTML What are the reasons for validating a HTML
Validating XML Validating XML Hi,
I have a string containing data in XML format. I have to Validate this xml data. Is there any method in java that allows strings as input to validate xml?
Please visit the following link:
http
validating - Swing AWT validating hi another problem i am facing in swing is that is
i have got many textfeilds
ex:
Roll No:
Name:
Address:
so
Roll No TextField have to Contains only Numbers.
Name TextFields have to contain only
validating email id validating email id how to validate the email id ?
<html>
<script>
function validate(){
var e=document.getElementById('email').value;
var regExpObj = /(\d\d\d)-\d\d\d\d\d\d\d\d/;
var reg
Validating the password field Validating the password field When the validate method returns back to the registration page the password field get cleared there by asking again one more time to enter the password field at the time of
re-submitting the form
validating username and password from database validating username and password from database Hello sir, i am developing a login page. i want that when i fill data in text fields. it validate data from database. if enter data is match from database. page goes to next page
Validating date in javascirpt - Development process Validating date in javascirpt
Hi Friends,
Can u plz give sample code for validating date in javascript using textbox.((dd--mm--yyyy format) Thank u in advance Hi,
The following code may be useful
validating text fields - Swing AWT validating text fields hi i am using NETBEANS IDE so when i want to validate TEXTFEILDS if one textfield is blank then it should focus on that particular textfield so help me with this plz.....
/*
* To change this template
Validating date in javascript - Java Interview Questions Validating date in javascript
Hi Deepak,
Can u give sample code validating date in javascript using text box. thank u in advance In what format you are going to enter the date in Text box (i.e : dd/mm
Validating Duplicate Entry To Database - Java Beginners Validating Duplicate Entry To Database I have a servlet that adds data to the table called foodtype in (Ms Access). i already have Chinese, vegetarian entered in table. what am trying to do is to validate when entering foodtypes
Validating Number Very Urgent - JSP-Servlet Validating Number Very Urgent Respected Sir/Madam,
I am R.Ragavendran.. I want u to insert the coding for validating number in the place of Emp ID text box.. I am sending the code for your kind reference which tends you
Validating Emp ID Reply - JSP-Servlet Validating Emp ID Reply Respected Sir/Madam,
I am Ragavendran.R.. Thanks for your quick response.. Actually I need to check whether Emp ID contains any Special characters and Alphabets..If yes,It must display "Please Enter
Validating User in JSP Validating User in JSP
Example program for validating user in JSP
In this example we have to develop a JSP... server for
running servlet.
Validating user means to find out whether the user
Excel Validating Value in Range
Excel Validating Value in Range
In this section, you will learn how to validate a cell's value within a
defined range using Apache POI.
EXAMPLE
In this below example, you will learn how to validate a cell's value within
Validating XML document with a DTD Validating XML document with a DTD
If an xml document is well formed i.e. syntactically correct, then it doesn't
mean it is valid also. To consider...;/article>
</articles>
Validating With the XML Parser With Internet Explorer
Developing Login Action Class
Developing Login Action Class
In this section we will explain how to write code for login action class and database code for validating the user against database
Check Date in PHP
Check Date in PHP
The Checkdate()
The PHP Checkdate function is used for validating the system date. It validate the Gregorian date. It returns 'True' if finds the specified date valid, otherwise it returns false.
Note
PHP Date and Time
PHP Date and Time
The PHP Date and Time function is massively used in setting date and time of the server, validating date and time and controlling the functions of the software.
The PHP date and Time functions allow you
Date validation in JSP
for validating date in a specified format in a JSP page
This example illustrates... JavaScript for validating date in a specified format as "MM/DD/YYYY". We are using JavaScript for validating JSP
at client side so that it will take less
HTML form validation using jquery
HTML form validation using jquery Is there any way for validating html elements common under a class by giving its class name in jquery validation code..that means validating all elements by using its class name if those
java - Struts
Java - Validating a form field in JSP using Struts I need an example in Java struts that validates a form field in JSP
Login Page
Login Page Can anyone tell me the steps to create a login page in myeclipse 7.0 and validating it with login database in db2 9.7 ???
Please tell me
JQuery as validation controller
JQuery as validation controller I would love to use JQuery as validation controller but i don't know how i use.Could u help me?
Here is a link that will provide you an example of validating email using jquery
javascript for prompt - JSP-Servlet
javascript for prompt Dear Sir,
I am using a prompt() for taking a reason for delete.I used your code,its working fine .but i am validating a prompt contains any special character or what.If contains a alert message has
servletss
such as name and password from a user and validating those credentials against some
3 tier architecture in java - JSP-Servlet
3 tier architecture in java H!,
My shopping cart project is created with html, jsp, servlets and oracle using weblogic server.
Html used for login page, jsp used for validating the username,password and connecting
make java application faster. - JSP-Servlet
make java application faster. Hello,
I am Dipti.I am working in a existing java project which is design with jsp ,java beans and in backend oracle.
for validating java script and designing with css.
The database queries
javascript date validation using regex
;title>Validating Date format</title>
<script type="text/javascript">...;/script>
</head>
<body>
<h2>Validating Alphanumeric value...;Validating Date format</title>
<script type="text/javascript">
File download security.
string validating the file that filters the file using FILTER_SANITIZE_STRING
Send forgot Password through mail - JSP-Servlet
Send forgot Password through mail
hello every one
I am designing a admin login page where i am validating the password through file(Example if user Name is Sreenivas and types sree as password i check a file where i
javascript
javascript please tell me sir,this query not validating correctly..whats wrong in this query?
<HTML>
<HEAD>
<TITLE>validate
<Script language = JavaScript>
function validate(theForm) {
var why="";
why
java script - Ajax
by Netscape in 1995 as a method for validating forms and providing interactive
struts
to validate like email, date, double
after validating it has to insert those details