开发者

how to send the value of "text box" even if it is grayed out/disabled in HTML?

开发者 https://www.devze.com 2023-02-07 20:23 出处:网络
I m doing like this in java script : document.getElementById(XYZ).value = \'32768\'; document.getElementById(ABC).value = \'32768 \';

I m doing like this in java script :

document.getElementById(XYZ).value = '32768';
document.getElementById(ABC).value = '32768 ';  
document.getElementById(XYZ).disabled = true;
document.getElementById(ABC).disabled = true;

when i m pressing submit it gives "0" as value. BUT i want to retrieve above values.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

readOnly is an option but it changes the FONT COLOUR from gray to black, but i want gray colored text in readOnly textbox

any help!!!!

开发者_StackOverflow

thanx !!!


Disabling an element takes it out of the form. The value will not be transmitted.

The only solution is not disabling the element. Depending on what you want to do, for example the readonly property could work for you.


I'd probably use readonly attribute and some CSS styles to gray them out like you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消