473,805 Members | 2,164 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reset form control style

Hi,

I've run across a problem styling form controls (quel surprise), or rather
in this case, "unstyling" them. I'm trying to put together a theme for a
web application which has a fairly primitive theme engine. Specifically, I
can define *additional* CSS rules using the theme engine, but I can't
remove the pre-existing ones that come with the application.

For the vast majority of the theme this hasn't been a problem given that
overriding stuff with CSS is hardly difficult. However, the base CSS rules
apply styles to most form controls (buttons, text areas, etc). I'd like to
override this to get the browser to render the form controls in the
"default" style, i.e. the way it would render them without any CSS rules
applied (usually the OS style in things like Opera, IE, Safari, etc).

Unfortunately, I haven't found any way of doing this - either in a
portable "clean" manner, or even in a browser-specific manner. I suspect
the answer is "you can't", but it doesn't hurt to check with the experts
:-)
Cheers,

Dave.
Dec 21 '07 #1
3 4058
rf

"Dave Hughes" <da**@waveform. plus.comwrote in message
news:op******** *******@stewie. waveform.plus.c om...
Hi,

I've run across a problem styling form controls (quel surprise), or rather
in this case, "unstyling" them. I'm trying to put together a theme for a
web application which has a fairly primitive theme engine. Specifically, I
can define *additional* CSS rules using the theme engine, but I can't
remove the pre-existing ones that come with the application.
Yes you can. Just use an additional rule specifying the default or initial
value. For example if the drezigner who designed the "applicatio n" specified
line-height as some number of pixels then specify line-height: normal;, the
initial value for this property.

--
Richard.
Dec 21 '07 #2
Scripsit Dave Hughes:
I'm trying to put together a
theme for a web application which has a fairly primitive theme
engine.
Just don't do that. Problem solved. Check some articles on usability.
The basic presentation of forms should be uniform _across the web_ to
serve the purpose of smooth _interaction_, rather than the dee-ziner's
artistic self-expression.
Specifically, I can define *additional* CSS rules using the
theme engine, but I can't remove the pre-existing ones that come with
the application.
What "applicatio n"? The browser? What _other_ "applicatio ns" underlie on
the web?
I'd like to override this to get the browser to render the form
controls in the "default" style, i.e. the way it would render them
without any CSS rules applied (usually the OS style in things like
Opera, IE, Safari, etc).
Just don't use "themes" for forms, mm'kay?
Unfortunately, I haven't found any way of doing this - either in a
portable "clean" manner, or even in a browser-specific manner.
There isn't, except perhaps in a highly browser-specific manner, and
usually not even that.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Dec 21 '07 #3
On Fri, 21 Dec 2007 14:31:12 -0000, Jukka K. Korpela <jk******@cs.tu t.fi>
wrote:
Scripsit Dave Hughes:
>I'm trying to put together a
theme for a web application which has a fairly primitive theme
engine.

Just don't do that. Problem solved. Check some articles on usability.
The basic presentation of forms should be uniform _across the web_ to
serve the purpose of smooth _interaction_, rather than the dee-ziner's
artistic self-expression.
I agree entirely. In fact, that's the problem...
>Specifically , I can define *additional* CSS rules using the
theme engine, but I can't remove the pre-existing ones that come with
the application.

What "applicatio n"? The browser? What _other_ "applicatio ns" underlie on
the web?
Perhaps "web application" is wrong phrase in this context, although I'm
not currently aware of a widely accepted alternative (at least in my
domain as a software developer). Anyway, the "web application" in question
is Trac (http://trac.edgewall.org/), specifically version 0.10.
>I'd like to override this to get the browser to render the form
controls in the "default" style, i.e. the way it would render them
without any CSS rules applied (usually the OS style in things like
Opera, IE, Safari, etc).

Just don't use "themes" for forms, mm'kay?
Indeed - Trac by default styles its forms (e.g. see
http://trac.edgewall.org/newticket), and I want *remove* the styling. I
don't actually think the default style is "bad" exactly (it's far from the
worst I've seen), but in the interest of usability I'd like to use the
browser's default style of controls as it's what the user is most likely
to be familiar with (especially in the case of browsers that use the OS to
render unstyled form controls).

Unfortunately, Trac 0.10's theme engine only allows one to define
*additional* stylesheets - one cannot remove the existing stylesheets
shipped with the application. Obviously, one could remove or edit the
stylesheets on a given installation but that's outside the purview of the
theme engine (and would break the ability to easily revert to the default
style should the administrator wish to do so).
>Unfortunatel y, I haven't found any way of doing this - either in a
portable "clean" manner, or even in a browser-specific manner.

There isn't, except perhaps in a highly browser-specific manner, and
usually not even that.
I'm aware this is the case for styling form controls, but I was hoping
(probably stupidly :-) that it might not be the case for "unstyling" them.
Given that I couldn't seem to find anything on overriding form control
styles to reset them to the browser's default (beyond "delete the rules"),
I was hoping I'd missed something obvious.
Thanks,

Dave.
Dec 21 '07 #4

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

Similar topics

1
8188
by: Joe Bloggs | last post by:
I have a form which includes a checkbox field. I need to add a reset, I add a HTML reset it works fine before I submit the form but not after. I know I must add some code to reset the checkbox on the onclick event of the reset button but I don't know what the code should be. Below is the HTML for the Data grid that has the check box and the code from the C# behind code for the reset button. If someone could point me in the right direction...
1
14387
by: NancyASAP | last post by:
Thought I'd share this since it took me a long time to get it working. Thanks to a bunch of contributers in Google Groups who shared javascript, etc. The question was: How can I put a reset button on my ASP.NET web page, and have an HTML reset button click clear 1) all validator text display and 2) validation summary display. Problem was clearing them and yet still leaving them working and visible if the user immediately began...
4
5335
by: Lee Chapman | last post by:
Hi, Can anyone tell me why in the code below, the call to ClearChildViewState() has no effect? To paraphrase the code: I'm using view state. I have a textbox and a submit button (and a label that can be ignored). When I press the button the first time, the click handler hides the textbox. Pressing the button a second time unhides the textbox. The text box is maintaining its value when hidden via view state. (The value is NOT being...
5
5995
by: Nathan Sokalski | last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an event is fired by one of the controls contained in the User Control, these variable are reset. Here is my current code (I have a little more to add later, right now I am just concerned about the variables getting reset): Public Class DatePicker2...
2
4841
by: Lance | last post by:
I want to be able to reset a complex property in a PropertyGrid. I know that for properties that are ValueTypes you can include System.ComponentModel.DefaultValue in the declaration of the property. But, for complex property types (e.g., instance types) this does not work because System.ComponentModel.DefaultValue requires a constant value In order to indicate if a property should be serialized you can include a boolean function named...
1
2025
by: sck10 | last post by:
Hello, I have a table with some controls in it, but it is not rapped in a form. I also have a button for reseting the page. When I click the button, the page resets, but I get the following error: "Done, but with errors on the page". I am trying to figure out a way to use JavaScript in my master page that can be used for all my content pages. Any help with this would be appreciated. Thanks, sck10
16
3660
by: Animesh K | last post by:
What's the best practice for using an image for a reset button? Unfortunately, we cannot use <input type="image" src="..."in this case. Any helpful tutorial from the web will be appreciated. I ran a google search, but a lot of "use my script" type junk websites are showing up. Best regards, Animesh
11
7430
by: newbie | last post by:
i have a form in which a hidden field (initial value as '0', and my javascript set it to '1' when an event is trigged). In the same form, i have a reset field. But I realized that the hidden field is not reset to '0' when i push the reset button. If I simply change the node from "<input type="hidden" id='IsChanged' value='0'>" to "<input type="text" id='IsChanged' value='0'>" Everything is working as expected (the value is reset to '0'...
2
3206
by: DarthPeePee | last post by:
Hello everyone. I am working on a Password Strength Meter and I am running into 1 problem that I would like to fix. When pressing the "Clear Password & Try Again" button, the password clears out of the text box, but the meter will stay at its current position until text is entered back into the textbox. Once text is re-entered, the meter will display the results again. I would like everything to reset when the button is pushed, but I...
0
9718
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...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10613
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5544
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...
1
4327
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
3846
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
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.