Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

Hide text and listbox

Hi!

Have this test site: -> http://jsfiddle.net/FNe7d/2/

The problem is that when i select "Varemottak" from listbox1
The two new listboxes is not align at the same line as the 2 other listboxes ?

Why ?
0
team2005
Asked:
team2005
1 Solution
 
Chris StanyonCommented:
It's because you're setting the hidden elements to display:block. You should set them to display: table-row

document.getElementById("sorteringkat").style.display = "table-row";
document.getElementById("kategorier").style.display = "table-row";

Open in new window

0
 
Ivo StoykovCommented:
on row 2 and 3 you have style="display: block" make them equal to line them up.

HTH

Ivo Stoykov
0
 
leakim971PluritechnicianCommented:
replace :
display = "block" by display = "table-row" :

http://jsfiddle.net/FNe7d/4/
window.onload = function() {
   document.getElementById("Rapport").onchange = function() {
        if(this.options[this.selectedIndex].text=="Varemottak") {
             document.getElementById("sorteringkat").style.display = "table-row";
             document.getElementById("kategorier").style.display = "table-row";
        }
        else {
             document.getElementById("sorteringkat").style.display = "none";
             document.getElementById("kategorier").style.display = "none";
        }

   }
}

Open in new window

0
 
team2005Author Commented:
Thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now