permaculture playing cards*
The moose likes HTML, CSS and JavaScript and the fly likes text field validations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "text field validations" Watch "text field validations" New topic
Author

text field validations

neeha sharma
Greenhorn

Joined: Jun 12, 2009
Posts: 11
hai my dear friends

i got a task recently which contains 25 text fields and no field have same value.
please tell me the best and efficient way to validate this problem.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30506
    
150

It sonds like you want to check none of the 25 fields contain a duplicate value. Do you want to do this in Java or JavaScript? In Java, you could put all the values in a HashSet and see that the size is 25 since the HashSet will remove all duplicates. In JavaScript, I think you'd need to write a loop.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Srikanth Nakka
Greenhorn

Joined: Apr 15, 2007
Posts: 26

if it is on web page you can easily done by javaScript


Thanking You,
Srikanth Nakka
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Srikanth Nakka wrote:if it is on web page you can easily done by javaScript


why not in java ? Jeanne Boyarsky mentioned already
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Without knowing anything about your environment, whether you want to do it in JavaScript or Java, it's difficult to provide helpful input.

Are they all named the same thing? Are they indexed? Java or JavaScript? Back-end framework or plain old servlets?
neeha sharma
Greenhorn

Joined: Jun 12, 2009
Posts: 11
i want to do it in java script
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61187
    
  66

Moved to the HTML/JavaScript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Read a form field

I hope you can figure out the rest from there.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: text field validations