简体   繁体   中英

Hide an input value on the Front end While maintaining the value on the Back

I am trying to hide an input value. I want to use an input text type as sort of a password input field. I dont want the values to be displayed though. How to go about hiding the value after an insertion has been made? I would like the values to be hidden.

I have tried a few methods but no luck. I still need to access this in jquery/AJAX so I can pass it into SQL for password verification. Any help is most appreciated. Thanks

HTML

<input type=text id=num1 onclick="hideValue()">

Javascript

function hidevalue(){
   document.getElementById('num1').value.visibility="hidden";
}

您只需要告诉它那是一个密码字段即可。

<input type="password" id="num1">

Use field type as password to mask entry made by user.

To hide that field on click use the following in the function

document.getElementById('num1').style.display = 'none';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM