Thanks for your attention. I am a new member, so they must be delaying me an entire day...
Just trying to understand this better, so here is where I am on this: This works: (It returns the ItemID which is '111') $(document).ready(function() { console.log($("input[name='ItemID']:checked").val()) }); This does not work: (It returns "Undefined") $(document).ready(function() { console.log($('#ItemList input:radio:checked').val()) }); Here is the <div> (with the coldfusion loop) <div id="ItemList"> <cfoutput query="cfqryItemList"> <input type="radio" name="ItemID" value="#ItemID#" <cfif FORM.ItemID EQ #ItemID#> checked</cfif>> </cfoutput> </div> It is the only Id="ItemList" on the page. On Mar 3, 9:01 pm, mkmanning <michaell...@gmail.com> wrote: > The problem with an id on the input is there are several inputs, and > you need to find which one is checked. > If you're containing div is #itemList then this should work if you > want the value: > > $('#itemList input:radio:checked').val() > > On Mar 3, 5:37 pm, James <james.gp....@gmail.com> wrote: > > > Oops, I forgot the id in the input: > > <input type="radio" id="ItemList" name="myRadio" value="blah" /> > > > Oh, and make sure you only have one id="ItemList" in your HTML. You > > cannot have several elements with the same id. > > > On Mar 3, 3:36 pm, James <james.gp....@gmail.com> wrote: > > > > The code looks fine. Do you have a value defined on your radio input? > > > > Suppose your input is: > > > <input type="radio" name="myRadio" value="blah" /> > > > > and your code is: > > > $("#ItemList:checked").val() // returns 'blah' if radio is checked > > > $("#ItemList").is(":checked"); // returns true if radio is checked > > > > On Mar 3, 3:56 am, Swatchdog <scott.swatch...@gmail.com> wrote: > > > > > I have an order edit form that is fed from Coldfusion/SQL that shows a > > > > radio list of possible product selections. If the customer is editing > > > > an order that has already been submitted, one of the products in the > > > > radio list is selected. If it is a new order, none is selected. > > > > > Upon load, I need to determine which one, if any, is selected so that > > > > I can turn manipulate other elements on the page. > > > > The div for the radio input list is id = ItemList. > > > > > This below does not work, it returns "Undefined" in the alert box. > > > > > $(document).ready(function() { > > > > alert($("#ItemList:checked").val()); > > > > > }); > > > > > Can someone throw this jPup a bone? > > > > > Thanks > > > > SWimmer