#id should really be unique. It's never a good idea to rely on $(#id)
retrieving multiple elements with that id.
If your radios have a name of 'Gender' (which seems likely) then you
could try...

$('input[name=Gender]').each(function(){ this.checked = (this.value ==
jsonData.feedback.Gender); });


On Oct 6, 3:48 am, Isaac <[EMAIL PROTECTED]> wrote:
> I have a page that retreives values from a database using an ajax
> call.  Then I take those values and try to populate a web form.
>
> The problem I'm having is with radio buttons.  I try setting them
> using the following line:
>
> $("#Gender").val(jsonData.feedback.Gender);
>
> where gender is 2 radio buttons with id="Gender" one has the value
> male and the other female.  This however does not appropriately
> display the radio button checked.  If you subsequently query the radio
> button value (like with an alert), it will display the appropriate
> value, indicating that setting it was successful but the display does
> not work.
>
> Any ideas would be greatly appreciated.

Reply via email to