Originally posted by Bear Bibeault:
I see no checkboxes in your code. I know that the ASP code will put them there, but this is an HTML forum. Please post the code after it has been processed so that the actuall HTML that is sent to the browser can be inspected.
Also, please be sure to disable smilies when posting code so that your code stops sticking its tongue out at people.
You are attempting to append checkboxes to a numeric value? Did you mean to use append()? Even so, you can only attach elements to the DOM, not numeric values. What are you really trying to accomplish?
The code you posted attempts to do just that.I am not sure what you mean with "your are attempting to append checkboxes to a numeric value?"
Ah, try something like:What I am trying to do is get the number of checkboxes that are checked and display them.
$('#targetDiv').html(someValue);
Originally posted by Bear Bibeault:
appendTo() is used to add DOM elements to the DOM -- not to set inner values.
This does not show up. Even though the method comes back with zero. I got to
do something like $("#targetDiv").html(howmany + "work"); and then I get 0work.
What up with that?
Originally posted by Bear Bibeault:
This statement:
will give you the count of checked checkboxes on the page. If you are finding other results you'll need to pare down your example to the simplest HTML page that shows the problem so that it an be diagnosed.
Works fine for me as evidenced by this test page:
I can't think of any reason that it shouldn't work -- assuming that an element with id of targetDiv exists at the time of execution.Originally posted by Michael Hubele:
I don't see anything.
.click() is a shortcut for bind('click').Also whats the difference between .click and .bind?
Shortcuts don't exist for all event types -- only the most-often used ones.Why would you use .bind to setup the stuff when they got stuff like .click?
The event instance is passed to all listeners as its parameter. If you are not going to reference the instance, there's no need to declare it.Also I seen people use function(event)-This is what I am using but whats the purpose of this. It seems like I don't need to actually pass the event in.
Originally posted by Bear Bibeault:
The event instance is passed to all listeners as its parameter. If you are not going to reference the instance, there's no need to declare it.
[ June 09, 2008: Message edited by: Bear Bibeault ]
When an event listener is invoked, it is passed a single parameter that is a normalized instance of Event. If you declare the event parameter, that will give you access to the instance. If you're not going to use it, you can leave it off or put it on. Doesn't matter. That's a JavaScript thing, not a jQuery thing.Originally posted by Michael Hubele:
I am not sure what you mean with this one.
Dude, you're right! I didn't try zero. it seems to work fine with any other numeric value. Let me see if I can find out what's up with that..I am not sure why it does not work either. Like I know it is going into that method since it does work. I can put $("#targetDiv").html(10); and it will show up. But if I put $("#targetDiv").html(0); It won't show up.
Yup. http://docs.jquery.com/Main_Page is working fine for me.Also is the jquery site up for you(like the tutorial or documentation pages?)
I now want to take my first checkbox(the one with the id="selectrow") and once thats clicked I want to check all the other 5 boxes.
Not sure what you mean by "archive this".So I am not sure what I could use to archive this.
Dude, you're right! I didn't try zero. it seems to work fine with any other numeric value. Let me see if I can find out what's up with that..
Yup. http://docs.jquery.com/Main_Page is working fine for me.
$('#firstCheckbox').click(function(){
if ($(this).attr('checked')) $(':checkbox').attr('checked',true);
});
You didn;t say you wanted to uncheck them all in lock-step so it doesn't do that.
That converts it to a string, which displays fine. The string '0' displays as well. it's just the numeral 0 that is a problem, which makes me believe that it's being misinterpreted as false somewhere in the jQuery code.Originally posted by Michael Hubele:
Ya its really weird. Like if you would put something after the 0 like a word the zero and the word will display.
Yup. Remember that jQuery selectors follow CSS rules. So if you place the "group" in a container (a <div> for example, or any other appropriate container), you can use the id of the div to limit the selection of the checkboxes:Now I need to somehow make group these checkboxes into groups. Since I am going to have quite a bit of rows of 6 checkboxes(with out being the select that row checkbox).
So does jquery have away to group them together?
We'll be here. You could also pick up a good book on the subject... (whistles innocently)Thanks so far for all your help. Stuff is making alot more sense but I know I am going to have alot more questions.
Originally posted by Bear Bibeault:
We'll be here. You could also pick up a good book on the subject... (whistles innocently)
[ June 09, 2008: Message edited by: Bear Bibeault ]
$('#containerOne :checkbox')
We'll be here. You could also pick up a good book on the subject... (whistles innocently)
Originally posted by Michael Hubele:
I love your chapter 2 selector tool very much. I am actually wondering is there a full tool like this on the web? Where you insert your own html and do selectors on it
$('tr#firstRow > td > input:checkbox').attr('checked', true);
and it worked. So I thought you needed a space.
Originally posted by Bear Bibeault:
Going forward, it'll probably be best to post each new question in its own topic (rather than letting this one ramble on and on). Also be sure to use UBB code tags when posting code to preserve its formatting and indentation.
Your project sounds really interesting and challenging, but I think your making good progress.
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|