• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

addEventListener invoking on loading page and not on button click

 
Ranch Hand
Posts: 462
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 462
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 462
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 462
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic