Html 隐藏表单域?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23968741/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 01:55:18  来源:igfitidea点击:

Hidden Form Field?

html

提问by saibbyweb

<form action="/action.php">
<input type="textbox" name="Username" readonly value=" ' . $user->username . ' ">
<input type="checkbox" name="check1" value="selected">
<input type="submit" value="submit"></form>

I want to hide the textbox input of the form from the user? The text box automatically collects the username of the logged in user of my website but i don't want to show it to them..It looks awkward. How to achieve hide it? Is there a way out?

我想对用户隐藏表单的文本框输入?文本框会自动收集我网站的登录用户的用户名,但我不想向他们展示......看起来很尴尬。如何实现隐藏呢?有出路吗?

回答by Hanky Panky

Well, just make it hiddenthen

好吧,hidden那就去做吧

<input type="hidden" name="Username" readonly value=" ' . $user->username . ' "> 

They can still see it in the source code though

他们仍然可以在源代码中看到它

回答by steven

<input type="hidden" name="Username" value=" ' . $user->username . ' ">