I'm using an array to add data to my database, and JavaScript to show and hide field depending on yes and no.
<input type="radio" id="medication1" name="medication[]" value="Yes" />
<input type="radio" id="medication2" name="medication[]" value="No" />
$("#show").hide();
$("input[name=medication]").click(function()
{
if ($("#medication1").attr('checked'))
$("#show2").hide();
if ($("#medication2").attr('checked'))
$("#show2").show();
});
Without the array block quotes it works perfectly but once I add them it doesn't. Is there maybe a way I can get around this?