disabled input box bug????

  • Thread starter Thread starter Tariq Ahmad
  • Start date Start date
T

Tariq Ahmad

hi,

i have a textbox into which i insert a value using
javascript and then disable (again using
javascript).

when i post the page back to itself and look at
the .Text property of the textbox it comes back
as blank!

any ideas please?

thnx.

t.
 
Hi,

Its because, when u disable a text box, and u try to request its value it wont come. So instead of disabling it, make it readonly.

Regards,
Bhaskardeep Khaund
hi,

i have a textbox into which i insert a value using
javascript and then disable (again using
javascript).

when i post the page back to itself and look at
the .Text property of the textbox it comes back
as blank!

any ideas please?

thnx.

t.
 
ok, so how can i use javascript to make the
textbox readonly?

i will try: document.formname.textbox.readonly = true;

thanks for ur help.

t.

Hi,

Its because, when u disable a text box, and u try to request its value it
wont come. So instead of disabling it, make it readonly.

Regards,
Bhaskardeep Khaund
hi,

i have a textbox into which i insert a value using
javascript and then disable (again using
javascript).

when i post the page back to itself and look at
the .Text property of the textbox it comes back
as blank!

any ideas please?

thnx.

t.
 
You could also try:

document.formname.textbox.onkeydown = function x() { return false; };
document.formname.textbox.onkeyup = function x() { return false; };

Mun
 
Back
Top