Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML Input Type?

Tags:

html

is there any special input type in HTML that is designed to only display values, based on say, other input? When nobody is allowed to write into it. Or is a disabled text box the best option?

like image 940
Trista N Avatar asked May 26 '26 14:05

Trista N


2 Answers

<input type="text" readonly />

The readonly attribute does your magic.

like image 137
Niet the Dark Absol Avatar answered May 30 '26 15:05

Niet the Dark Absol


Nowadays its very easy to remove readonly attribute on browser. I suggested you to use label or span and write few lines of css codes for that label element to become look like input box.

<label>test value</label>

<style>
label {
    padding:3px;
    border:1px solid black;
    width:200px;
}
</style>
like image 33
sanris Avatar answered May 30 '26 14:05

sanris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!