use a tag html on onclick javascript function -


hi im having problem tag in html, want use tag call java script function have on folder js have javascripts. tried looking answers didnt find answer solve problem. know function working because if try using input onclick insted of onclick working, in terms of aesthetics tag works better. have code

this function in a folder /myproject/source files/js

function formhash(form, password) {     // create new element input, our hashed password field.      var p = document.createelement("input");      // add new element our form.      form.appendchild(p);     p.name = "p";     p.type = "hidden";     p.value = hex_sha512(password.value);      // make sure plaintext password doesn't sent.      password.value = "";      // submit form.      form.submit();     } 

and html page has this:

<div class="user_login">     <form action="includes/process_login.php" method="post" name="login_form">         <label>email / username</label> <input type="text" name="email" /> <br /> <label>password</label>         <input type="password" name="password" id="password"/> <br />          <div class="action_btnns">             <div class="one_half">                 <a href="#" class="btnn back_btn"><i                                             class="fa fa-angle-double-left"></i> back</a>             </div>             <div class="one_half last">                 <a  class="btnn btnn_red" href="javascript:void(0);" onclick="formhash(this.form, this.form.password)">login</a>                 <!--<input class ="btnn btnn_red" value='login' onclick='return formhash(this.form, this.form.password);'-->              </div>         </div>     </form>      <a href="#" class="forgot_password">forgot password?</a> </div> 

if press button login, in page nothing happening. please if me great, thank you


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -