• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IP Address Validation

 
Chinni Bujji
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your code that is not working?
 
Trilochan Bharadwaj
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[removed]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very true! thanks for pointing it out, message loud and clear Bear!


Trilochan.
 
Chinni Bujji
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




That is my javascript method and those four text boxes

 
Chinni Bujji
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Return false from the event handler.

And the "javascript:" prefixes are superfluous. Remove them.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic