PDA

View Full Version : Having a problem with visibility/form/onClick compatability


Vercingitorix
05-21-2003, 11:53 PM
I'm having difficulty getting my javascript to work properly.

I'm not sure how to post code on these particular forums, so I'll do my best to explain.

The whole thing is a big 'bio' form, for my guild in the game of Everquest. One of the form things is a select form allowing them to select their class, which also determines their epic quest.

A little later on in the page I have a radio set asking if they've started their epic yet, if they hit yes it calls a Javascript function. It took me a while to realize that for some inexplicable reason document.all and document.bio (bio is the form's name) work randomly based on a healthy dose of trial and error.

Now below this I have a div id set with a style-visibility-hidden thing. A whole bunch of these in fact. All sitting on top of each other. And based on the class they choose it will display the epic checklist appropriate to them. And when they select no it turns everything hidden again (I'm 300% positive there is a more intelligent and efficient way to do it, than the way I have done, but I'm still learning)

The problem I seem to run into is, that regardless of the position setting I use each time I turn one of the epic checklists visible it's like there is a /p code in front of it for each class above the currently displayed one.

Also I can't seem to set the document.bio.class.value to a variable nor can I do that to a document .all.pclass.visibility to a variable, I think that would help me out a bit.

I've figured 90% of everything I've done by looking at other code snippets and just looking at the final design and working backwards until I somehow figure it out enough to make it work and make me smile.

If anyone knows where I'm going wrong with this or if you need me to post the code, let me know how and I'll do so promptly.

Thank you in advance for any help given.

A1ien51
05-22-2003, 03:05 AM
with divs, you are going to need to use document.all and getElementByID

with the style.visibility attribute

look at the code of this page

http://www10.brinkster.com/A1ien51/JavaRanch/showhidetoggle.htm

A1ien51

Vercingitorix
05-22-2003, 03:54 AM
I see what your saying, here take a look at this I put up the page so everyone will know what I'm trying to say a little better....at least I hope.

Now the only two working classes are Bard and Warrior. Try them both right after each other, without clicking the no on the epic link, the form doesn't require you to fill anything out just select bard or warrior and press yes next to the started epic radio's. See how it stacks, now take a look at the code, where did I mess up?

http://ndbeta.iwebland.com/members/biostest.php

What I did was build what I wanted the bio page to look like and then try and build the form page around that.

http://ndbeta.iwebland.com/members/bios.php

If anyone has any suggestions on how to better this code or knows any decent tutorials or dictionaries or anything out there that might help me I'd much appriciate it.

*edit*

Doh, forgot to make it netscape viewable, I'll add it in later! Just noticed your message on that page about it.