BluePaper 0 Light Poster

Seeing as I like being able to have as much control over the things I make as possible it means I will rarely use the inbuilt ASP.net controls (i.e. the login system provided or the inbuilt verification) I will however use the <asp:****> controls in order for my applications to work.

Anyways, to the point, I'm making my own registration page and I want to verify a users password and email by making them enter the data twice. I'd like the application to use real time verification using JavaScript. So I've set up this little bit of JS to compare the two fields, however I need the function to 'run' everytime something in the field changes so I would normally use the onKeyPress or onChange attribute available for normal html tags. When I add an onChange="comparefields()" to an ASP.net tag (in this case <asp:TextBox>) it doesn't like it seeing as it's not one of the things I can add.

So basically:

  • User Enters password
  • User enters password again
  • The application continuously checks to see if the passwords are the same:
  • - If so show a tick
  • - If not show a cross and keep the submit button disabled

I can work on the actual JS side of things, it's just getting the function to run when I want it to run from the textbox tag...I hope I explained myself, if not please do say and I'll try again, thanks.