473,661 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to submit "disabled" form elements

Hi,

I have a form with various elements which, according to changes in
values become enabled or disabled.

The disabled elements are normally not submitted, but I wish they
were. How can I go about making elements appear to be disabled, but
still send them when the form is submitted.

Thanx,
Ittay
Jul 23 '05 #1
1 11623
Ittay Dror wrote:
The disabled elements are normally not submitted, but I wish they
were. How can I go about making elements appear to be disabled, but
still send them when the form is submitted.


Disabled form controls are not submitted by design (in W3C speak: 'they
are not successful').

Your options (in my order of my personal preference):
1. Re-engineer the application logic to not need to send disabled form
controls to the client in the first place.
2. Hidden fields
3. Use 'readonly' instead
4. Hidden fields *and* disabled fields (may confuse the user if disabled
data ends up being submitted?)
5. CSS styled to appear as disable (user may still modify data and you
don't know what 'disabled' looks like on all browsers)
6. Javascript to re-enable disabled form controls before form submission
(inaccessible and unreliable)
--
Andrew Urquhart
- FAQ: www.jibbering.com/faq/
- Archive: www.google.com/groups?q=comp.lang.javascript
- Contact: www.andrewu.co.uk/contact/
- Employ me: Front/middle tier ASP developer with WAI & web standards
Jul 23 '05 #2

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

Similar topics

2
3595
by: Askari | last post by:
Hi, I do a "perso"widget where have two scrolls (one vertical, one horizontal) for a canvas. When, the first time, I added widget in the canvas, the scroll self-ajust and when I move scrollbar, the surface's canvas "moved". But when I deleted (.destroy) this first widgets and that a added other widget, the scrollBar become disabled (ajust for no scroll on the canvas). What/where is the problem?
5
2593
by: Jeremy Langworthy | last post by:
Hi I have two "totals" inputs whose values are dynamically calculated. For obvious reasons I don't want users to be able to edit the information in these. However, I do want this total passed to the next page so I can store it. When I set the input to "disabled" it does not pass it's value. Is there another way I can do this? I was thinking about using an onFocus event to set the focus to another field but is this the best option? Any...
2
5457
by: CES | last post by:
All, I'm at a loss, the code below works in IE but not in Netscape and I'm unskilled enough not to know why. Essentially this code looks thru all of the form fields and if the input box has a attribute of disabled="true", attribute would only be present if the field was disabled, then the label field's class is changed to a grayed out color. --- The first problem seems to be with the v==true statement, I've tried
1
6680
by: Kruse | last post by:
Hi, Is Possible to alter the "disabled" style? I have got <input name="test" value="1" disabled> This makes the input field gray and shadow.
5
2468
by: Mark Hannon | last post by:
I have been researching the "disabled" property for form data and wanted to know: - Does the disabled property supress the form item from being submitted? - Can the disabled property be applied when the submit button is pressed? I am designing a PayPal order page that will have 4 items, each with a 3-character text box where the customer will enter quantity. The default value will be "0." I want to be able to test whether the
0
1232
by: Dana Epp | last post by:
Anyone know how to set the "Disabled" imagelist in a C# Toolbar? Although the Microsoft's Toolbar ActiveX control in the mscomctl.ocx has such a property, there doesn't seem to be one for the C# version. Anyone know a work around for this? --- Regards, Dana M. Epp http://silverstr.ufies.org/blog/]
1
2669
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 the textbox is disabled. The same question applies for a listview. When the listview is disabled, the backcolor of the listview turns grey (shadowed) for the area which is not filled
1
1312
by: Lars Netzel | last post by:
I have an application with MDIchildren... you have have several windows open at the same time and when I choose "Save" from the Parent Window (MDIContainer) I save the ActiveMDIChild. BUt.. I also have other windows that are MDI Children, like Settings and Administration forms.. and when they are active I dont't want the save option in the Menu of the parent form to be enabled anymore... where do I trigger this and how do I do this?
0
1267
by: Curious | last post by:
Hi, I try to set up debugging environment in Visual Studio 2003. So I open the Properties of the project and select "Debugging". I'll need to at first enter "C:\Program Files\AutoTrade\MyTools \TSF_Server_1.exe" in the "Debug Mode" entry. However, this entry is disabled/greyed out. I'm unable to enter anything. Any advice on how to get this entry enabled?
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8542
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2760
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1740
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.