473,387 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Disabled TextBox

i have a textbox server control whos value is being changed using javascript.
when the text is changes and i post back to the server the Text change is
not reflected, instead i get blank string.
if the TextBox enabled property is set to true , everything works fine.
any ideas?
thanks in advance
Sep 27 '06 #1
1 1769
"Toty Santana" <To*********@community.nospamwrote in message
news:E5**********************************@microsof t.com...
>i have a textbox server control whos value is being changed using
javascript.
when the text is changes and i post back to the server the Text change is
not reflected, instead i get blank string.
if the TextBox enabled property is set to true , everything works fine.
any ideas?
Yep - this is, ahem, "standard" behaviour... :-)

Thankfully, the solution is simple enough, though: don't set the textbox
readonly property in the HTML markup - do it in code instead. E.g.

Don't do this:
<asp:TextBox = ID="MyTextBox" runat="server" Enabled="false" />

Do this instead:
<asp:TextBox = ID="MyTextBox" runat="server" />

And in the page's Page_Load event, do this:
MyTextBox.Attributes.Add("disabled", "true");
It's the same with the readonly attribute...
Sep 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JS | last post by:
I have a textbox and a button. Sometimes this textbox will be disabled and other times it will be enabled. When its disabled I guess its value is null. But is the the text string "null" or is it...
1
by: Morten Plathe | last post by:
Hi, Is there a way to override the shadowed (grey) backcolor of a textbox when the textbox is disabled for input (textbox.enabled = false) ? In some cases I want to have a custom backcolor when...
3
by: Steve Le Monnier | last post by:
When you make a textbox control disabled ( txtText1.Enabled = false; ) You're left with grey text on a greyer background, which is not ideal. The Read-Only property is no use to me as I need to...
5
by: Robert Phillips | last post by:
I have a Panel control containing a few TextBox controls. The Panel is originally enabled, I enter data into the TextBox controls. When I submit, the Panel is disabled during the PostBack and the...
8
by: CsaaGuy | last post by:
I have a requirement to disable some textboxs depending on their contents. I choose to do this by invoking some javascript. When they change the contents, i disable the textbox they just put new...
3
by: Eric Moreau | last post by:
Hi I have a user that is visually impaired and who cannot read textboxes content when they are disabled. I have tried to inherits from the Textbox and overwrite the Paint method but I have...
0
by: sunny076 | last post by:
Hi, I am having difficulties creating a derived class for DisabledDataGridViewTextBoxColumn and cell when the VisualStyle is not supported. Basically I am down to either using ControlPaint or...
3
by: BrendanMcPherson | last post by:
How can I get a listbox to change a textbox on some selections. I have a listbox which only needs to be filled in on some selections. Is there a way I can have on some selections the textbox go...
7
by: garyusenet | last post by:
I'm using krypton toolkit which has allowed me to make a cool looking form. However, when I set my textbox to disabled it is 'greyed' out. The grey colour isn't in keeping with the office 2007...
1
by: hal | last post by:
I have a web page using javascript to enable/disabled an image button and switch its image when values are entered into a couple of textboxes. I have all that working fine, but my code considers a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.