Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

JavaScript that can stop processing

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a webapp running in Apache and Tomcat using JSPs, Servlets, and Java Beans. I also use some javascript to do some error checking before submit is clicked.
What I need to do is if there is an error in the form upon either clicking save, hitting enter, or tabbing out, popup an alert telling them there is an issue.
However, even when the click submit, the error pops up but the submit process still takes place. Is there a way to get that to stop??
Thanx
 
ryan headley
Ranch Hand
Posts: 156
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nevermind, I got it to work.
I needed to do this: (this is general code not my code exactly)

Then in my code, if the test failed the function had to return false, else it returned true.
Problem solved...
 
You ridiculous clown, did you think you could get away with it? This is my favorite tiny ad!
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic