Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18425

Re: <select> Drop-Down List not 'dropping'

Newsgroups comp.lang.javascript
Subject Re: <select> Drop-Down List not 'dropping'
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <anl4rnF3retU1@mid.individual.net> <XnsA161E8264E964eejj99@194.109.133.133> <anlfe4F66ohU1@mid.individual.net> <anoclhFq1t6U1@mid.individual.net>
Date 2013-02-10 10:05 +0100
Message-ID <XnsA16366A00F573eejj99@194.109.133.133> (permalink)

Show all headers | View raw


Mel Smith wrote on 10 feb 2013 in comp.lang.javascript:

> Evertjan:
> 
>     I managed to get the <select> list to drop down on focus. However
>     (as 
> the example below shows),  the set of inputs on the same line as the
> select get 'pushed down' and destrop the screen layout.
> 
> Can you give further guidance please ??

As I wrote,
you will have to do this with a css position command, like:

position:fixed;

or

position:absolute;

It just takes some playing with these css-settings, I trust.

I am not an expert in this, 
I would do the same experimental testing as you could.
 
> function setFocusSize(selobj) {
> if (selobj.id == "imth") selobj.size = "13" ;
>}
> 
> function resetFocusSize(selobj) {
> if (selobj.id == "imth") selobj.size="1" ;
>}

Why test for the specific object?
The eventhandlers in the object link the use to that object.

Methinks, more compact, 
[and the one function can be used for different select objects]:

==========================================
function changeFocusSize(selobj,size) {
    selobj.size = size;
};

<select size='1' 
onfocus='changeFocusSize(this,13);' 
onblur='changeFocusSize(this,1);'
>
===========================================

or even shorter 
[I prefer this, no distant functions necessary,
it shows exactly what you want it to do]:

==========================================
<select size='1' 
onfocus='this.size = 13;' 
onblur='this.size = 1;'
>
===========================================

> <select id="imth" size="1" onfocus="setFocusSize(this);" 
> onblur="resetFocusSize(this);">
>    <option value="XXX" disabled="disabled">Pick Month</option>

No need for a value here,
what is the intended effect of your disabling?

>    <option value="Jan">January</option>
>    <option value="Feb">February</option>
>    <option value="Mar">March</option>
>    <option value="Apr">April</option>
>    <option value="May">May</option>
>    <option value="Jun">June</option>
>    <option value="Jul">July</option>
>    <option value="Aug">August</option>
>    <option value="Sep">September</option>
>    <option value="Oct">October</option>
>    <option value="Nov">November</option>
>    <option value="Dec">December</option>

I would be using serverside code,
perhaps needing the months names elsewhere to,
and perhaps translate the page to another natural language:

<% 
var mnds = ['January','February','March','April','May','June',
  'July','August','September','October','November','December'];

for (var i=0;i<11;i++)
  Response.write "<option value='" +
  m[i].substr(0,3) +
  "'>" +
  m[i] +
  "</option>";
%>

> </select>



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

<select> Drop-Down List not 'dropping' "Mel Smith" <med_cutout_syntel@aol.com> - 2013-02-08 13:17 -0700
  Re: <select> Drop-Down List not 'dropping' "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-08 22:49 +0100
    Re: <select> Drop-Down List not 'dropping' "Mel Smith" <med_cutout_syntel@aol.com> - 2013-02-08 16:18 -0700
      Re: <select> Drop-Down List not 'dropping' "Mel Smith" <med_cutout_syntel@aol.com> - 2013-02-09 18:49 -0700
        Re: <select> Drop-Down List not 'dropping' Gregor Kofler <usenet@gregorkofler.com> - 2013-02-10 09:36 +0100
          Re: <select> Drop-Down List not 'dropping' "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-10 10:08 +0100
        Re: <select> Drop-Down List not 'dropping' "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-10 10:05 +0100
          Re: <select> Drop-Down List not 'dropping' "Mel Smith" <med_cutout_syntel@aol.com> - 2013-02-10 08:17 -0700
            Re: <select> Drop-Down List not 'dropping' "Mel Smith" <med_cutout_syntel@aol.com> - 2013-02-10 10:06 -0700
              Re: <select> Drop-Down List not 'dropping' SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-02-10 18:59 +0100
                Re: <select> Drop-Down List not 'dropping' "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-10 19:40 +0100
                Re: <select> Drop-Down List not 'dropping' SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-02-11 02:59 +0100
                Re: <select> Drop-Down List not 'dropping' "Mel Smith" <med_cutout_syntel@aol.com> - 2013-02-10 12:03 -0700
                Re: <select> Drop-Down List not 'dropping' SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-02-11 02:39 +0100
              Re: <select> Drop-Down List not 'dropping' "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-10 19:31 +0100
                Re: <select> Drop-Down List not 'dropping' "Mel Smith" <med_cutout_syntel@aol.com> - 2013-02-10 11:45 -0700
                Re: <select> Drop-Down List not 'dropping' "Mel Smith" <med_cutout_syntel@aol.com> - 2013-02-10 17:50 -0700
                Drop Down Works ! , But .... "Mel Smith" <med_cutout_syntel@aol.com> - 2013-02-12 10:44 -0700
                Re: Drop Down Works ! , But .... "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-12 19:46 +0100
                Re: [CSS] Drop Down Works ! , But .... SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-02-13 01:57 +0100
                Re: [CSS] Drop Down Works ! , But .... "Mel Smith" <med_cutout_syntel@aol.com> - 2013-02-12 18:23 -0700
                Re: [CSS] Drop Down Works ! , But .... SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-02-13 15:37 +0100
                Re: [CSS] Drop Down Works ! , But .... "Mel Smith" <med_cutout_syntel@aol.com> - 2013-02-13 09:35 -0700

csiph-web