| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Rock it out.
Join Date: Dec 2007
Posts: 209
|
JS/CSS integration, minor help needed
Hello again, all. I love coming up with funny little quirks, so I thought I'd throw this one at ya: I am making a page that uses Javascript to put a three-page form into one page, flipping thru the pages and then submitting it. The Javascript and CSS I wrote hide the other two pages while one is being looked at/filled out. Works great. Problem is, I was employing a similar JS method on one page of the form, which hides most of it until certain options are selected, like so: Sample Unfortunately, this is mixed with some CSS which has the value "visibility:visible", which I believe is bypassing the JS "hide" command (in a nutshell, that radio button form in the "sample" don't work no more, and I think this is the problem). Please take a look, and see if there's s/g I'm missing and/or need to improve (and forgive if the JS or HTML is sloppy. Haven't quite gotten the hang of it): Uckfay. Thanks in advance! |
|
|
|
|
|
#2 (permalink) |
|
goober :-)
|
Right... There's several things that you are doing wrong here...
All that having been said, it actually appears to work ok for me here. I'm getting a javascript error at some point... Script is looking for an id starting with a #... Although thats how you notate it in your css, the # isn't part of the id though. Other than that... It works. Hope all that helps. Didn't mean to be too critical, so don't take offence... Just trying to help you head in the right direction... Its awful to learn something one way then have to relearn because you find out you've been doing it wrong all this time... Cheers David My signature sucks.
|
|
|
|
#4 (permalink) |
|
goober :-)
|
You can set up a javascript to get elements with a particular attribute... For example, get all <span> elements with a rel attribute of "popup" or something. From there, you can assign the actions it needs as onclick, onfocus etc directly in the js. My signature sucks.
|
|
|
|
#5 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,658
|
Here is the code I've used up 'til now: Code:
I'm thinking you mean that I can do this instead (set to run onLoad): Code:
Is that right? |
|
|
|
#6 (permalink) |
|
goober :-)
|
yeah... along those lines. You don't necessarily need to use IDs... you can combine methods to get other results... for example: to get all <span> elements with a classname of "popup" within a div with an id "sidebar": Code:
My signature sucks.
|
|
|
|
#8 (permalink) |
|
Rock it out.
Join Date: Dec 2007
Posts: 209
|
Djeglin, thank you for the critique and no, I didn't take offense to any of it. It helps to know what I'm doing wrong (even if it's almost everything Do you know of any way that I can make it work with what I've got, though? I'm trying to first just get the site up (everything is done except for this form) and then go through and fine-tune everything, semantically speaking. It's not an overly-remarkable site, so it won't matter if it's not all pretty in pink when it's up, and then I can go about perfecting it as I learn. I just need it up |
|
![]() |