SunQuest
           CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 15th, 2003, 08:09 PM
kinguakid kinguakid is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 5 kinguakid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
document.forms[] & CSS

document.forms array - PLEASE HELP
I have a form with multiple, nested <div>'s that i want to hide/show using CSS by clicking on different links.

I am getting errors with the following code...


function showForm(elmnt)
{
for (i=0;i<document.forms[0].elements.length;i++)
{
document.forms[0].elements[i].style.visibility="hidden";
}
switch(elmnt)
{
case "frmClient":
document.forms[0].frmClient.style.visibility="visible";
document.forms[0].txtName.focus();
break;

(i then have many different case statements for the <div>'s i wish to hide/show)

A sample of my <div> usage is:
<div class="form">
<form method="get" action="writeRequest.php">
<!---------------------------links to diff areas of form---------------->
<div>
<a href="#" class="tab" onclick="showForm('frmClient')">Client</a>
<a href="#" onclick="showForm('frmBldg')">Bldg </a>
<a href="#" onclick="showForm('frmFloor')">Floor </a>
<a href="#" onclick="showForm('frmPower')">Power </a>
<a href="#" onclick="showForm('frmRefceil')">Refceil </a>
<a href="#" onclick="showForm('frmFurn')">Furn </a>
<a href="#" style="WIDTH:60px" onclick="showForm('frmElevSect')">Details</a>
<a href="#" style="WIDTH:65px" onclick="showForm('frmAreaCalc')">Area Calcs </a>
<a href="#" style="WIDTH:60px" onclick="showForm('frmFinishes')">Finishes </a>
<a href="#" style="WIDTH:69px" onclick="showForm('frmPlngConst')">Plng/Const </a>
<a href="#" onclick="showForm('frmNotes')">Notes </a>
</div>

(I then have similar <div>'s containing other 'form areas' until I finally close all the <div>'s and the form)

I am getting errors like 'document.forms.0.frmClient.style is null or not a valid object.

What is wrong with this code?


__________________
I greatly appreciate any help you can offer. Thanks!

Gari

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > document.forms[] & CSS


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway