Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
For empty filed there is any regural expression.
Posted
Comments
W Balboos, GHB 26-Aug-14 8:47am    
Have you done anything on this problem, yourself?
Member 11036676 27-Aug-14 2:37am    
I am put this expression for text field.but it not work. /^([a-zA-Z]){1,20}$/
I want expression for empty field.
W Balboos, GHB 27-Aug-14 7:24am    
You need to use DOM to get the contents.
You need to use php or javaScript to analyze the contents by whatever rules you use to define 'empty'
You need to then handle the result (true/false, for example).

Beginner?
If you are in school, you should seize the struggle so as to learn. Create tests. See what they do. Develop methods that you can (personally) use to solve problems.



Sinisa Hajnal 1-Sep-14 6:37am    
For an empty field you do NOT need regular expression, simply write (field.value == null)

The expression above, if I remember my rusty regex, takes 1 to 20 letters, no spaces. Google it, its not hard.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900