HighDots Forums  

Select Element

alt.html alt.html


Discuss Select Element in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Maag
 
Posts: n/a

Default Select Element - 05-24-2008 , 05:58 PM






I am interested in using a Select element but I want to know if there is any
way to specify the width and height of the object.

I realize the width will auto size to the data but would still like to know
if it can be done. Just to be clear what I am trying to do I will paste some
code:

<select name="attribute[]" size=5 multiple>
<option value="perky">Perky</option>
<option value="morose">Morose</option>
<option value="thinking">Thinking</option>
<option value="feeling">Feeling</option>
<option value="thrifty">Thrifty</option>
<option value="prodigal">Prodigal</option>
</select>



Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Select Element - 05-24-2008 , 06:20 PM






Scripsit John Maag:

Quote:
I am interested in using a Select element but I want to know if there
is any way to specify the width and height of the object.
You can use the CSS properties width and height, e.g.

<select ... style="width: 10em; height: 8em">

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


Reply With Quote
  #3  
Old   
John Maag
 
Posts: n/a

Default Re: Select Element - 05-24-2008 , 06:58 PM



Thanks Jukka. I really appreciate it.

"Jukka K. Korpela" <jkorpela (AT) cs (DOT) tut.fi> wrote

Quote:
Scripsit John Maag:

I am interested in using a Select element but I want to know if there
is any way to specify the width and height of the object.

You can use the CSS properties width and height, e.g.

select ... style="width: 10em; height: 8em"

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



Reply With Quote
  #4  
Old   
John Maag
 
Posts: n/a

Default Re: Select Element - 05-25-2008 , 09:42 PM



As a followup to this, is there a way to space fields within the list? What
I am trying to do is have information such as name, address, city state and
zip line up in columns. I have been trying to use sprintf as follows but it
seems to ignroe extra spaces between fields.

Here is an example of the sprintf I have been using. I am using the x's to
prove the formatting actually does work if the paddign character is not
space.
$line1 = sprintf ("%' -40s%'x-40s%'x-20s%'x-10s\n", "John Maag", "100 Maple
Ave", "Our Town", "10101");


"John Maag" <foo (AT) foo (DOT) com> wrote

Quote:
I am interested in using a Select element but I want to know if there is
any way to specify the width and height of the object.

I realize the width will auto size to the data but would still like to
know if it can be done. Just to be clear what I am trying to do I will
paste some code:

select name="attribute[]" size=5 multiple
option value="perky">Perky</option
option value="morose">Morose</option
option value="thinking">Thinking</option
option value="feeling">Feeling</option
option value="thrifty">Thrifty</option
option value="prodigal">Prodigal</option
/select




Reply With Quote
  #5  
Old   
Adrienne Boswell
 
Posts: n/a

Default Re: Select Element - 05-25-2008 , 11:57 PM



Gazing into my crystal ball I observed "John Maag" <foo (AT) foo (DOT) com> writing
in news:Pzo_j.4203$mh5.1287 (AT) nlpi067 (DOT) nbdc.sbc.com:

Please do not top post.. see response at the bottom of the message.
Quote:
"John Maag" <foo (AT) foo (DOT) com> wrote in message
news:8c0_j.324$89.302 (AT) nlpi069 (DOT) nbdc.sbc.com...
I am interested in using a Select element but I want to know if there
is any way to specify the width and height of the object.

I realize the width will auto size to the data but would still like
to know if it can be done. Just to be clear what I am trying to do I
will paste some code:

select name="attribute[]" size=5 multiple
option value="perky">Perky</option
option value="morose">Morose</option
option value="thinking">Thinking</option
option value="feeling">Feeling</option
option value="thrifty">Thrifty</option
option value="prodigal">Prodigal</option
/select


As a followup to this, is there a way to space fields within the list?
What I am trying to do is have information such as name, address, city
state and zip line up in columns. I have been trying to use sprintf as
follows but it seems to ignroe extra spaces between fields.

Here is an example of the sprintf I have been using. I am using the
x's to prove the formatting actually does work if the paddign
character is not space.
$line1 = sprintf ("%' -40s%'x-40s%'x-20s%'x-10s\n", "John Maag", "100
Maple
Ave", "Our Town", "10101");

Use the right tool for the job - a table. If this is for a form, you
could do something like that below:
<form method="post" action="whateverpage">
<table>
<thead>
<tr>
<th>Select</th><th>Name</th><th>Address</th><th>City</th><th>State</th>
<th>Zip</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="radio" name="attribute[]" value="id"></td><td>John Doe
</td><td>123 Any Street</td><td>Any City</td><td>XX</td><td>99999</td>
</tr>
<!-- more choices -->
</tbody>
</table>
<p><input type="submit" value="Submit Choice"></p>
</form>

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share



Reply With Quote
  #6  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Select Element - 05-26-2008 , 01:59 AM



Scripsit Adrienne Boswell:

Quote:
Use the right tool for the job - a table.
Agreed; when the data consists of entries of data that consists of
components by the same structure, then it's very much tabular data.

Quote:
If this is for a form, you
could do something like that below:
- -
td><input type="radio" name="attribute[]" value="id"></td><td>John
Doe </td><td>123 Any Street</td><td>Any
City</td><td>XX</td><td>99999</td
Especially when you need put an input field and its label to different
cells (and this is probably better here than putting them into same
cell), their logical relationship should be indicated using <label>
markup:

<td><input type="radio" name="attribute[]" value="id"></td><td><label
for="id">John Doe</label></td><td>123 Any Street</td><td>Any
City</td><td>XX</td><td>99999</td>

You'll have to use _different_ id values for each element, but this is
not a problem if the page is programmatically generated. You can e.g.
make the program produce id1, id2, ... - these identifiers need not be
descriptive or mnemonic, since they are not visible to users.

Using <label> markup implies, among other things, that many browsers let
the user click on the label (name) to toggle the radio button setting,
instead of trying to hit the tiny button.

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



Reply With Quote
  #7  
Old   
Adrienne Boswell
 
Posts: n/a

Default Re: Select Element - 05-26-2008 , 12:26 PM



Gazing into my crystal ball I observed "Jukka K. Korpela"
<jkorpela (AT) cs (DOT) tut.fi> writing in news:Zks_j.6882$_03.5624
@reader1.news.saunalahti.fi:

Quote:
Especially when you need put an input field and its label to different
cells (and this is probably better here than putting them into same
cell), their logical relationship should be indicated using <label
markup:

td><input type="radio" name="attribute[]" value="id"></td><td><label
for="id">John Doe</label></td><td>123 Any Street</td><td>Any
City</td><td>XX</td><td>99999</td

Thank you for the tip, Jukka.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share



Reply With Quote
  #8  
Old   
John Maag
 
Posts: n/a

Default Re: Select Element - 05-26-2008 , 12:57 PM



Quote:
Use the right tool for the job - a table. If this is for a form, you
The problem with a table is you have to "page through" the data. Example if
you could only display 20 entries on a page you would have to go through
pages 2and, etc. That is why I preferred a scrollable window.

Is ther a way to scroll and have columnar data?




Reply With Quote
  #9  
Old   
Adrienne Boswell
 
Posts: n/a

Default Re: Select Element - 05-26-2008 , 03:23 PM



Gazing into my crystal ball I observed "John Maag" <foo (AT) foo (DOT) com> writing
in news:l_B_j.2744$co7.768 (AT) nlpi066 (DOT) nbdc.sbc.com:

Quote:
Use the right tool for the job - a table. If this is for a form, you

The problem with a table is you have to "page through" the data.
Example if you could only display 20 entries on a page you would have
to go through pages 2and, etc. That is why I preferred a scrollable
window.

Is ther a way to scroll and have columnar data?



Using a drop down would be even worse. Who wants to scroll through 20
entries? Give the user a search function, or don't page at 20 records.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share



Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.