This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jQuery and checkbox

 
Malini Rao
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to set chkHead to true when both chkTbl are true and vice-versa..
But nothing seems to work...

can anyone help??

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your script must be in a ready handler. It is executing before the DOM is even loaded so there's nothing to apply methods to.

You're also mixing up classes and id values. Get them straightened out.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. chkTbl and chkHead are horrible, unreadable names. What did vowels ever do to you? Why not choose nice readable names with the vowels left in?
 
Malini Rao
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had an alert in the click event for chkTbl and it worked when the checkbox was selected/deselected...
So that is not an issue I guess...
 
Malini Rao
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a small part of code from an application.. Sorry for horrible names.. they are just there since eternity..
 
Malini Rao
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Sorry
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Malini Rao wrote:I had an alert in the click event for chkTbl and it worked when the checkbox was selected/deselected...
So that is not an issue I guess...

Nope. Impossible as the code is written.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post back the code once you've got it straightened out. (assuming you still having issues after fixing this problems.)

By the way, it was a good call to pare the code down to a small example rather than posting huge code blocks. Most people will just ignore those.
 
Malini Rao
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about that.. I had just put the main parts.. forgot about document.ready...
This one works.... And explained more clearly...
Thanks
 
Malini Rao
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And I am using jquery 1.4 if that helps...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not go back and change a post after you've made it. It just makes the replies that have already been made look stupid.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic