◽ HTML & CSS & JS, jQuery

[HTML] <input>태그 값 못 쓰게 막기. readonly, disabled

1
2
3
4
5
6
7
8
<input type="text" id="txt1" readonly />        
<input type="text" id="txt2" disabled />
 
<textarea id="txtfield1" readonly ></textarea>
<textarea id="txtfield2" disabled ></textarea>
 
<input type="password" id="pass1" readonly />
<input type="password" id="pass2" disabled />


comment : 'readonly' , 'disabled' 둘다 사용자의 입력을 하지 못하게 막는 기능은 동일하지만,

form 안에서 사용하였을 경우,

'readonly' 는 form 전송이 가능하지만,

'disabled' 는 form 전송시 값이 전달되지 않는다.



유의하기 바란다.

푸터바