Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Firefox issue with showing/hiding hidden div tags
Old 02-12-2009, 06:18 PM Firefox issue with showing/hiding hidden div tags
ADeacon's Avatar
Experienced Talker

Posts: 32
Name: Andrew
Location: Texas
Trades: 0
Hello,

I'm a novice with JS. I have a form that is broken down into four parts. I use a small amount of script to move from one part of the form to the next. It works fine in Safari and IE, but won't work in Firefox. When you click on the "Part Two" button, it doesn't switch out the divs.

The JS that governs this switch is:


<script type="text/javascript" language="javascript">

function setVisibility(id, visibility) {
document.all[id].style.display = visibility;
}

</script>

The CSS in the div tags to make them hidden are just display: none;


The button at the bottom of the page:


<input value="Part Two" type="button" onClick="setVisibility('formOne', 'none');setVisibility('formTwo', 'inline');">

If anyone has any ideas, please let me know. Your help is greatly appreciated. The link is below.

http://www.drawninwardmedia.com/nurs..._full_app.html
ADeacon is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-12-2009, 06:23 PM Re: Firefox issue with showing/hiding hidden div tags
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
Use document.getElementById(id) instead of document.all[id].
And change onClick to onclick, just in case.
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 02-12-2009, 06:31 PM Re: Firefox issue with showing/hiding hidden div tags
ADeacon's Avatar
Experienced Talker

Posts: 32
Name: Andrew
Location: Texas
Trades: 0
That works. Thanks a bunch.

I noticed one more thing. at the last step of this form, you have to choose one of two forms to fill out. When the data is sent via email, both of the last parts of the form is sent. One would be filled out and the other blank. Is there any script I can use to say if this hidden div is blank, exclude it from being sent?
ADeacon is offline
Reply With Quote
View Public Profile
 
Old 02-13-2009, 03:19 AM Re: Firefox issue with showing/hiding hidden div tags
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
Just check the value of each in the POST, and disregard the empty one?
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Firefox issue with showing/hiding hidden div tags
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.51846 seconds with 12 queries