• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

simple javascript form

 
ankur mawandia
Greenhorn
Posts: 12
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a html form and with a few fields
i want to md5 my password field before posting it

here is my code





can some one please tell why my password field in not being md5ied


thanks in advance
 
Blaidd Gwael
Greenhorn
Posts: 13
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One problem is when you click the submit button.
The javascript method writes the result AFTER the form has been submited.

For example if you write



when you click the link it will go to a1.

Replace the submit button with a normal one (type="button").
Try to send the form from javascript after you execute "crypt()". There is a "submit()" method for forms.
Other errors can be present but I think this is the problem.
 
ankur mawandia
Greenhorn
Posts: 12
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i made the following changes

added a line


in function crypt

and changed the button type to button to submit but now the form is not geting submitted
 
Blaidd Gwael
Greenhorn
Posts: 13
Eclipse IDE Hibernate Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to debug the code. Place alerts before and after every line from the function crypt and see if it gets there.
I recommend Firebug. It's a great tool for firefox that helps you with the javascript errors.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic