HTML + values out of two text forms -


i need way values out of 2 text forms/fields , put them in 1 hidden textbox.

e.g. password 1: water password 2: 12561

the hidden password-form should contain "water12561"

why need this? have otrs-login otp(one time password) , want authenticate user otp , password stored in mysql-db/ldap. normal way is, user has type in both values in 1 filed isn't way in opinion. because of reason want create 2 field , set password in 1 field submit perl-script.

btw - there no php installed on machine.

here quick snippet works via javascript. made password field visible can see working. you'll need make password field hidden meet requirements.

document.getelementbyid("button").addeventlistener("click", function(){      concatfields();  });    function concatfields()  {    var val1 = document.getelementbyid("input1").value;    var val2 = document.getelementbyid("input2").value;    var password = val1 + val2;      document.getelementbyid("password").value = password;  }
<div>    <label>input 1</label>    <input id="input1" type="text" placeholder="add value here">  </div>  <div>    <label>input 2</label>    <input id="input2" type="text" placeholder="add value here">  </div>  <div>    <label>password</label>    <input id="password" type="password" placeholder="do not add value here">  </div>  <div>    <input id="button" type="button" value="concat field 1 , 2, insert field 3">  </div>


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -