473,387 Members | 1,771 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.

input tickboxes

Hi

I would like to to make a form with tickboxes:

[ ] option 1
[ ] option 2

etc...

Where the tickbox ( [ ] )is on the same horizontal line as the text.

Do I need to use any tricks?

Thank you

Nicolaas

Jul 12 '07 #1
3 2200
rf

"windandwaves" <nf*******@gmail.comwrote in message
news:11**********************@57g2000hsv.googlegro ups.com...
Hi

I would like to to make a form with tickboxes:

[ ] option 1
[ ] option 2

etc...

Where the tickbox ( [ ] )is on the same horizontal line as the text.
Do I need to use any tricks?
Why would they *not* be on the same line?

--
Richard.
Jul 12 '07 #2
Scripsit windandwaves:
I would like to to make a form with tickboxes:

[ ] option 1
[ ] option 2

etc...
I suppose that by "tickbox", you mean a checkbox (which is rendered as "[ ]"
by text browsers like Lynx and as a small square by most graphic browsers).
Where the tickbox ( [ ] )is on the same horizontal line as the text.

Do I need to use any tricks?
What's the problem? What is your markup? Using markup like

<fieldset>
<legend>The question here</legend>
<div><label><input type="checkbox" name="o" value="1"option
1</label></div>
<div><label><input type="checkbox" name="o" value="1"option
2</label></div>
...
</fieldset>

is an easy way. You could omit the div markup if you set label { display:
block } in CSS, but that's not advisable, since the stuff would appear on
one line (within the limitations of available width) when CSS is off.
Instead of div markup, you could use <brto create line breaks, but that's
less structural.

If you mean the _exact_ horizontal positioning, then the answer is that by
default, the checkbox and the label text are aligned to text baseline
(vertical-align: baseline). The rendering of checkboxes is not specified in
any specification, but typically the square has its bottom edge on the
baseline. In this sense, it _is_ on the same horizontal line as text, and
this is normally OK. You could fine-tune this by setting vertical-align for
the input elements, but why would you?

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

Jul 12 '07 #3
Jukka K. Korpela wrote:
>
<div><label><input type="checkbox" name="o" value="1"option
1</label></div>
FYI, IE won't really associate[1] the label with the checkbox unless you
include the "for" attribute, which means giving the checkbox an id. I
don't know if this was corrected in IE7 or not.

[1] Clicking on the label checks/unchecks the checkbox.

--
Berg
Jul 12 '07 #4

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

Similar topics

3
by: david | last post by:
HI! Im trying to make "HTML form" into automatic. 1. If I get 18 numbers like: A B C D E F . . . . 2. How can I put those 18 numbers automatically into 6 numbers format like: A B C D E F
2
by: SophistiCat | last post by:
Hi, I am working on a computational program that has to read a number of parameters (~50) from an input file. The program contains a single class hierarchy with about a dozen member-classes or...
2
by: Cranky | last post by:
Ok, here is my scenario: I need to input numbers using my handheld IPAQ. I figured out how to create an online numeric keypad for inputting numbers into an input field, what I need to know is how...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
3
by: cbradio | last post by:
Hi, I am having trouble developing a form in a restricted environment. My sample code is found below my message (sorry I don't have a URL). Basically, without a doctype, the form displays properly...
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
1
by: tcertain | last post by:
I am totally duh at javascript although I have 2 books trying to learn it. I am trying to add values to a form and have a calculate total at end. this is my form script. I have hours at end of...
1
by: printline | last post by:
Hello All I'm quite new to xml vs. PHP, so i hope someone can help with an issue i have been struggeling with. I have an html form, that when submitted, it should create an xml file, and save...
8
by: Dan2kx | last post by:
New question.... I have my continous form constructed of data from a query, i want to select records to edit (See thread) using unbound tickboxes, how can i link these? Thanks (again), Dan
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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,...
0
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,...
0
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...

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.