[英]HTML/CSS Making a textbox with text that is grayed out, and disappears when I click to enter info, how?
[英]how to send the value of “text box” even if it is grayed out/disabled in HTML?
我在Java腳本中這樣做:
document.getElementById(XYZ).value = '32768';
document.getElementById(ABC).value = '32768 ';
document.getElementById(XYZ).disabled = true;
document.getElementById(ABC).disabled = true;
當我按提交,它給出“ 0”的價值。 但我想檢索以上值。
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
readOnly是一個選項,但是它將字體顏色從灰色更改為黑色,但是我想在readOnly文本框中輸入灰色文本
任何幫助!!
謝謝!
禁用元素會使它脫離表單。 該值將不會發送。
唯一的解決方案是不禁用元素。 例如,取決於您想做什么, readonly
屬性可能對您readonly
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.