Code Hash Function Over Data In Form - Already Have Function But Don't Know Where To Call November 26, 2023 Post a Comment I have form in my html page As A Row I need your help, if the following code below counts every … How To Make A Transition Effect Up The Input On Change I need to place this particular effect on a dropdown I need… Some Questions About Tree Construction [html Spec] I know that it's not customary to ask a bunch of questi… December 2024 (1) November 2024 (37) October 2024 (60) September 2024 (16) August 2024 (364) July 2024 (339) June 2024 (687) May 2024 (1293) April 2024 (775) March 2024 (1501) February 2024 (1648) January 2024 (1335) December 2023 (1303) November 2023 (376) October 2023 (556) September 2023 (310) August 2023 (324) July 2023 (279) June 2023 (360) May 2023 (215) April 2023 (145) March 2023 (139) February 2023 (171) January 2023 (271) December 2022 (139) November 2022 (223) October 2022 (176) September 2022 (159) August 2022 (293) July 2022 (82) <formonsubmit="return myOnSubmit(this);">CopyJavaScriptfunctionmyOnSubmit(aForm) { //Getting the two input objectsvar inputUsername = aForm['username']; var inputPassword = aForm['password']; //Hashing the values before submitting inputUsername.value = sha256_hash(inputUsername.value); inputPassword.value = sha256_hash(inputPassword.value); //Submittingreturntrue; } CopyEDIT : Because of the 'Hashing the values before submitting' part, it will not work if you have a maxlength property, because hashed values are much longer than just the clear password.If you MUST use a maximum length, then you would need to implement HIDDEN FIELDS and changing those values, and making sure the fields containing the clear data aren't submitted (outside of the <FORM> tag).Solution 2: <button dojoType="dijit.form.Button"class="soria" style="border: 1px solid black; float:right;"type="submit" onclick="username.value=sha256_hash(username.value);password.value=sha256_hash(password.value)">Login</button></td> CopyGenerally when you send sensitive data, you have only to worry about password, so you can hash password and leave user as it. Share You may like these postsMobile Safari - Reliable Callback For When Image Loads?Render Nested Object In ReactjsClone And Delete Selected Row To Another TableHow To Get Orphaned Text With Jsoup? Post a Comment for "Code Hash Function Over Data In Form - Already Have Function But Don't Know Where To Call"