Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Re: select statement question...

Thread Tools

Re: select statement question...

Jukka K. Korpela
Posts: n/a
Scripsit dba:

> Trying to use size parameter in select statement. Problem... it raises
> the box from the line instead of lowering it.

The select element is inline by default, and it participates in
rendering as if it were a large letter. In particular, its lower edge
sits on the baseline of text.

> Select an area {box with multiple select items only showing one} then
> select a {box with multiple select items only showing one}. Select
> boxes line up with the text line.

That's because the elements are vertically smaller than the line height,
or just a little taller. (Actually, what matters is whether the element
is taller than the distance from baseline to the upper edge of the line,
as defined by its line height.)

> However, when I use the size parameter to show two variables at a time
> the box moves up on line instead of down one line. Is there a way to
> reverse that and have the box "lower?" on line?

To change this, you change the vertical-align property of the select

You can add the following to your CSS stylesheet:

select { vertical-align: text-top; }

> Any assistance will be appreciated.

The best approach is to put one input item and its label on one line.
This is good for clarity and for accessibility. Example:

<div><label>Area: <select ...>...</select></label></div>

You may still have the same problem in rendering, but the solution is
the same. Besides, now you have the option of using a table, with labels
in one column, input fields in another.

Don't try to construct a sentences that contain input items. If
explanations are needed, present them as such as text before the input

Jukka K. Korpela ("Yucca")

Reply With Quote
Jukka K. Korpela
Posts: n/a
Scripsit dba:

> Using a form to present database fields for selection. Have been
> trying using radio buttons etc to get it so the user can select one
> person from a multiple person presentation. Not have any success.

Can you please post the URL of your attempt? The basic idea is that you
just a have a set of <input type="radio" ...> elements with the same
name="..." attribute. There are complications if you want to make things
work smoothly and reliably, especially the initial selection problem
(see ), but apart from
that, the following approach should work well:

<div>Please select a person:</div>
<div><label><input type="radio" name="person" value="John Doe">John
<div><label><input type="radio" name="person" value="Jane Doe">Jane

Jukka K. Korpela ("Yucca")

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
if statement that, when false, skips first statement in its block, executes second? Jay McGavren Java 11 01-16-2006 05:49 PM
How do I do a conditional statement in a constant statement? VHDL 3 12-16-2005 06:13 PM
exec "statement" VS. exec "statement in globals(), locals() Ted Python 1 07-22-2004 08:51 AM
exec "statement" VS. exec "statement" in globals(), locals() tedsuzman Python 2 07-21-2004 08:41 PM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM