Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-15-2011, 04:12 PM   PM User | #1
virtualcreative
New to the CF scene

 
Join Date: Nov 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
virtualcreative is an unknown quantity at this point
Help with JS "check all/ uncheck all" box

New here and not a JS wizard (at all). I need to get two little buttons working for check all/uncheck all on a form list. When I isolate the script on this page:
http://www.hotelfandb.com/subscribe/hot-leads-test.htm
the buttons work.

When call this form from another page it does not, even when I put the script in the head file (topnew-copy.asp)
Here's the one those same buttons won't work on:
http://www.hotelfandb.com/subscribe/...yfree-test.asp

Does anyone have any ideas why, and how to get around it?

Help is much appreciated!
virtualcreative is offline   Reply With Quote
Old 11-15-2011, 04:23 PM   PM User | #2
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
Use a validator to fix your HTML.

You can't just drop a whole HTML page, including doctype and all, right into the middle of another HTML page and expect it to work.
__________________
.My new Javascript tutorial site: http://reallifejs.com/
.Latest article: Calculators — Tiny jQuery calculator, Full-fledged OOP calculator, Big number calculator
.Latest quick-bit: Including jQuery — Environment-aware minification and CDNs with local fallback
venegal is offline   Reply With Quote
Old 11-15-2011, 04:29 PM   PM User | #3
virtualcreative
New to the CF scene

 
Join Date: Nov 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
virtualcreative is an unknown quantity at this point
Unfortunately its not up to me - I didn't design the page, just being asked to make the check box work. The hot leads file it is calling in is in several pages. Should it be an asp file instead? (basically, what can I do to get the javascript to work?)
virtualcreative is offline   Reply With Quote
Old 11-15-2011, 05:30 PM   PM User | #4
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
Basically, you're nesting two forms, which is not allowed, so the browser won't see the inner form, which you are trying to access using Javascript. What you could do is access those checkboxes as elements of the outer form instead. I won't go into more detail, though, since this is not the right way to fix this. Validating the HTML is.
__________________
.My new Javascript tutorial site: http://reallifejs.com/
.Latest article: Calculators — Tiny jQuery calculator, Full-fledged OOP calculator, Big number calculator
.Latest quick-bit: Including jQuery — Environment-aware minification and CDNs with local fallback
venegal is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:17 AM.


Advertisement
Log in to turn off these ads.