Reply to Re: drop down lists

Your name:

Reply:


Posted by Jonathan N. Little on 11/11/65 11:54

JMcC wrote:
> hello,
>
> Im trying to do a wee trick with drop down lists. Im creating a form
> with 4 drop down lists on it that a user has to fill in. I dont want
> to overwhelm the user so what I want is when the page loads up only 1
> drop down list is present and then when a selection is made in that
> list the next drop down list appears. To do this I was looking into
> using a JavaScript function but I keep running into an error and im not
> to sure how to fix it. Could someone please take a look at this code
> and see if they can help.. Thanks and regards

Well I question the usefulness but you have a real DOM error here.
>
> <html>
> <head>
> <title>test</title>
> <style>
> .vis1 { visibility:visible }
> .vis2 { visibility:hidden }
> </style>
>
> <script type = "text/javascript">
> <!-- Hide JavaScript from older browsers
>
> function make_visible(id_no)
> {
> drop = document.getElementById(id_no);
> drop.class="vis1";


that is drop.className not drop.class

also it is a good idea to limit the scope of variables in functions, use
the 'var' keyword

var drop = document.getElementById(id_no);

else drop is global and can lead to nasty debugging issues.


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация