473,657 Members | 2,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select on input type

Is it possible to craft a selector that selects on input type?

It would be useful to be able to distinguish between type="text" and
type="checkbox" .

Sep 19 '07 #1
5 4258
Hans Malherbe schrieb:
Is it possible to craft a selector that selects on input type?

It would be useful to be able to distinguish between type="text" and
type="checkbox" .
Look up the various attribute selectors in CSS 2.x.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Sep 19 '07 #2
Scripsit Johannes Koch:
Hans Malherbe schrieb:
>Is it possible to craft a selector that selects on input type?

It would be useful to be able to distinguish between type="text" and
type="checkbox ".

Look up the various attribute selectors in CSS 2.x.
And beware of the Drag... I mean Internet Explorer 6 and older. IE 6 is
still the most commonly used browser, and it does not understand attribute
selectors. (Also note that CSS 2.1 is a draft that says that it may change
at any moment with no warning, and CSS 2.0 as such has in effect been
rejected both by the W3C and browser vendors, and there is no other CSS 2.x.
Good luck. :-( )

The practical solution, thus, as mentioned about monthly in this group, is
to use a clumsier approach that uses selectors that even IE 6 understands.
Class selectors are the simple way, but often you don't need to add a class
attribute into _each_ <inputelement . For example, if you group checkboxes
into fieldsets so that they only appear inside <fieldsetelemen ts that
contain no other input elements, you can use e.g.
<fieldset class="checkbox es"...
and the selector
.checkboxes input

Or if your form has 42 input fields, 41 of them with type="text" (expressed
or implied) and one with type="submit" and you want to make the font in text
input fields monospace (great idea - simple, but few people have found it),
you can use just <input type="submit" class="submit" ...and

input { font-family: Consolas, Courier New, monospace; }
input.submit { font-family: sans-serif; }

That is, you set the property for the element in general, then override it
for those cases where you don't want it.

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

Sep 19 '07 #3
Jukka K. Korpela wrote:
>
Also note that CSS 2.1 is a draft that says that it may change
at any moment with no warning
You often mention this, but realistically what are the chances that it
*will* change? Pretty close to zero, don't you think?

--
Berg
Sep 19 '07 #4
Bergamot wrote:
Jukka K. Korpela wrote:
>Also note that CSS 2.1 is a draft that says that it may change
at any moment with no warning

You often mention this, but realistically what are the chances that it
*will* change? Pretty close to zero, don't you think?
From the CSS working group's own words (7/20/07):
The CSS WG published the new Candidate Recommendation (CR) for CSS level
2 revision 1, with the firm intention that there won't be any more
working drafts.

From CSS 2.1 CR draft:
Features at Risk:
New 'list-style-type' values:
'armenian'
'georgian'
'lower-greek'
Multiple ID attributes for ID selector
Automatic table layout algorithm
Quotes
BODY element in XHTML (transfer special case in HTML to XHTML)

I'd give the chance of the relevant part of the draft -- attribute in
CSS selector, which is actually CSS 2, of being changed somewhere
between the inverse Ackermann function of one over Grahm's number and zero.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Sep 19 '07 #5
Scripsit Bergamot:
Jukka K. Korpela wrote:
>>
Also note that CSS 2.1 is a draft that says that it may change
at any moment with no warning

You often mention this, but realistically what are the chances that it
*will* change? Pretty close to zero, don't you think?
It depends. Is 0.42 close to zero?

The CSS 2.1 drafts have a sad history of slow progress and odd changes, and
there was already a move back (downwards) in the "standardizatio n" path.

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

Sep 20 '07 #6

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

Similar topics

1
5242
by: JT | last post by:
I have an input form for which I've created a "matrix" for user input. Basically, the user chooses a radio button and then through javascript, a select box is displayed to define a value for that radio option, like so: Choice: (Radio1) type: (select box1) Choice: (Radio1) type: (select box2) Choice: (Radio1) type: (select box3) Choice: (Radio1) type: (select box4) Choice: (Radio1) type: (select box5)
4
7391
by: bobsawyer | last post by:
I've been building a series of SELECT lists that are populated dynamically using HTTPRequest. Things are going pretty well, and I've got the whole thing working flawlessly in Mozilla/Firebird. Unfortunately, Internet Explorer doesn't quite work as expected -- it gives me an "invalid argument" error that I don't know how to fix. Here's the entire script, with form, annotated to explain what I'm doing and where the problem is occurring. I...
5
9568
by: _andrea.l | last post by:
I have n checkboxes and 1 checkbox 'SELECT ALL'. for example: <form action="" method="get"> <input name="sa" type="checkbox" value="v"> select all <input name="c1" type="checkbox" value="v"> option 1 <input name="c2" type="checkbox" value="v"> option 2 <input name="c3" type="checkbox" value="v"> option 3 .... <input name="cn" type="checkbox" value="v"> option n </form>
3
2672
by: eholz1 | last post by:
Hello PHP programmers. I had a brilliant idea on one of my pages that selects some data from my mysql database. I first set the page up to display some info and an image, just one item, with a row of data, etc. then I thought it would be nice to do a select, and perhaps an update (the title of the image) on the same page.
1
1424
Wiccadwitch
by: Wiccadwitch | last post by:
Could someone please help??? I'm using paypal's shopping cart which allows for 2 options (such as colors or sizes). I need up to six options with 40 or so colors to choose from. I tried adding 6 but in paypal.com cart it only displays #'s 1 and 6. 2-5 get cut out. Paypal tech gave a website of www.members.aol.com/paypalhelper and said to create select multiples. I did this but there's still something wrong with my code. I can select...
2
2568
by: Tarik Monem | last post by:
OK! I've gone through a few tutorials and I cannot understand what I'm doing wrong casting_registration.php <table> <tr> <td> <form enctype="multipart/form-data" action="thankyou.php" method="post" name="registrationform"> Choose a shows:
21
29771
by: Leena P | last post by:
i want to basically take some information for the product and let the user enter the the material required to make this product 1.first page test.php which takes product code and displays prodcut anme have used ajax to avoid refreshing of page this works fine 2.now i have created one row with checkbox|select box|text|text|text|text| where in the select box values are fetched from table here also i have used ajax for getting the m_name...
3
2914
by: matwilko | last post by:
hi, i am trying to create a simple version of itunes...and i am using iframes to do this. I have already set up the iframes using dreamweaver and used a drop-down menu to select the genre. When selecting the genre the artists appears in iframe1...and i want to be able to select the artist so that the songs appear. I am unsure of how to do this, could anybody help? Thanks Here is my current code... <html> <head> <title>MiTunes</title>...
25
5387
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if my question needs to be here or in coldfusion. If i have my question is in the wrong section i am sorry in advance an will move it to the correct section. Basically i have a multiple select box. An it works except for this one part i want to add to it.The first box i have is called project members which shows the users you can choose to send an email to and the other box is called assignees which is the...
2
3821
by: viki1967 | last post by:
Hi everyone. My form page htm: <html> <head> <script language="javascript"> function controlla_combo() { document.form1.Nacionalidad_text.disabled = document.form1.Nacionalidad.checked;
0
8397
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
8310
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
8732
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...
1
8503
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
7333
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...
0
5632
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
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
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.