Code:
<script>
$('input[name=sell]').click(function() {
if (this.value === "yes")
{
$('#haveBl').show();
alert ("selly = " + this.value);
}
else
{
$('#haveBl').hide();
alert ("selln = " + this.value);
};
});
</script>
Of course, you don't need those alerts then. There are various ways. If you want to get real cute, you can use the value as the name of the action to take:
Code:
<p>Will you be selling Products and/ or services during the rally?</p>
<input type="radio" id="selly" name="sell" value="show"> <label for="selly">Yes</label><br>
<input type="radio" id="selln" name="sell" value="hide"> <label for="selln">No</label>
<script>
$('input[name=sell]').click(function() {
$('#haveBl')[this.value]();
});
</script>
But if the input is submitted later as part of a form or AJAX call (neither of which it looks like right now, but I'm not sure), the sell name will have that (show or hide) value. But that might not be a bad thing.
Bookmarks