wood burning stoves*
The moose likes HTML, CSS and JavaScript and the fly likes IP Address Validation 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 "IP Address Validation" Watch "IP Address Validation" New topic
Author

IP Address Validation

Chinni Bujji
Ranch Hand

Joined: Jan 31, 2007
Posts: 60
Hello,

I am writing a javascript function to validate the IP address

I have 4 text boxes with maximum length of 3

When I reach the maximum length of 3 I am able to tab to another text box

Similarly I am trying to tab on entering a period/dot(.) but no luck yet

If you any ideas or some code that would be really helpful for me

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

Where is your code that is not working?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Trilochan Bharadwaj
Ranch Hand

Joined: Feb 02, 2009
Posts: 100
[removed]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

Trilochan, at JavaRanch we encourage people to write their own code. We will give the poster all the help he needs to get his code running, but it doesn't do anyone any good to just give out answers.

Please read this for more information.
Trilochan Bharadwaj
Ranch Hand

Joined: Feb 02, 2009
Posts: 100
Very true! thanks for pointing it out, message loud and clear Bear!


Trilochan.
Chinni Bujji
Ranch Hand

Joined: Jan 31, 2007
Posts: 60




That is my javascript method and those four text boxes

Chinni Bujji
Ranch Hand

Joined: Jan 31, 2007
Posts: 60



I have a written a new javascript function for this
but the period/dot is carried to the next text box
I dont want to display the period/dot but the use can enter it

Any ideas how to remove the period
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61095
    
  66

Return false from the event handler.

And the "javascript:" prefixes are superfluous. Remove them.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: IP Address Validation