• 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

addEventListener invoking on loading page and not on button click

 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two problems I'm having here...

One, as soon as I load the page, it is trying to invoke the addEventListener without waiting for the submit button to be clicked.





The 2nd problem is, even when the passwords do match, it is not accepting them as equal.  Is there a better way to write this?

 
Nathan Milota
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've changed my function to the following to correct that I didn't add the .value to the variables, but it still isn't working properly.  





What it's doing is when I submit, it is entering empty strings into all the values even if I put values in, and it clears the form when the page reloads.  
 
Nathan Milota
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tweaked a little bit, but the problem mainly is that it clears everything as soon as I submit, it quickly logs to the console and goes away, but doesn't add anything to the database with the way I have it now.  

I have no idea what is going on or why it is doing this.
 
Nathan Milota
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got most of it fixed.   Some of the mistakes were simply novice errors.   I'll post another reply if I'm still having an issue related to this problem.
 
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!