This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin Cookbook and have Ken Kousen on-line!
See this thread for details.
Win a copy of Kotlin Cookbook this week in the Kotlin 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Joe Ess
  • salvin francis

how to call two function on button click or submitting the form

Ranch Foreman
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a form which have two tabs one for sign-in and the other for sign-up. I am having two separate functions for each tab. On sign-in after entering username and password, Its again throwing the alert message as username can not be blank. Where i am wrong. Please help me.

Staff note (Bear Bibeault):

As this has nothing to do with JSP it has been moved to a more appropriate forum.

Posts: 4412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you sharing a form?
Indeed, why are the two tabs using the same id's for fields?
That's a mistake.

At the moment, because you have forced the two unrelated actions into a single one, you are trying to so two unrelated validations on a single submit.

Just make them two forms (and give the fields different ids).
That feels good. Thanks. Here's a tiny ad:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!