Im hoping someone could supply me the JQUERY code to check what the value of a choice field is.
I thought I needed to check a checkbox type field so I started with:
if ($("input[title$='Phone Data Collection']").is(':checked'))
…and looked for a change event with…
$("input[title$='Phone Data Collection']").click(function() { //If checkbox is checked then hide the fields if (this.checked)
But now that I know it is a choice field I’m a little lost. Please help…
Here is what I just used to do something based on the value of the choice field.
bType = jQuery(‘select[title=”Title of Field on Page”] option:selected’).html();
//show and hide fields
if(bType == ‘foo’) {
jQuery(“select[title=’bar’]”).closest(‘tr’).show();
} else {
jQuery(“select[title=’bar’]”).closest(‘tr’).hide();
}