0

I hope someone can help. I'm something of a coding novice, so I hope the explanation below makes sense!

I've created a custom list and applied code to show/hide columns depending on the answer selected in a top level 'choice' field. This is working well.

However, as this code is driven by the 'title' field it is being negated when I then add an additional snippet to hide the tooltips that automatically appear over the answer fields (because this also references the 'Title' field).

The tooltips simply display the content of the 'title' field when the answer field is hovered over. This is uneccessary when the title field is already clearly displayed on the page.

Is there a way of hiding the tooltips without referencing the 'Title' field?

The code I'm currently using is as follows:

Dynamic Questions

<script src="https://code.jquery.com/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
if ($("select[title='column name']").val() != "choice that needs to be dynamic")
{
$('nobr:contains("sub question 1 to show")').closest('tr').hide();
$('nobr:contains("sub question 2 to show")').closest('tr').hide();

}
else
{
$('nobr:contains("sub question 1 to show")').closest('tr').show();
$('nobr:contains("sub question 2 to show")').closest('tr').show();
}

//Show/hide columns based on Drop Down Selection
$("select[title='column name']").change(function() {
if ($("select[title='column name']").val() != "choice that needs to be dynamic")
{
$('nobr:contains("sub question 1 to show")').closest('tr').hide();
$('nobr:contains("sub question 2 to show")').closest('tr').hide();
}
else
{
$('nobr:contains("sub question 1 to show")').closest('tr').show();
$('nobr:contains("sub question 2 to show")').closest('tr').show();
}
});
});
</script>

Remove Tooltips

<script type="text/javascript">
    $(document).ready(function(){
        $("[title]").attr('title','');
    });
</script>

Thanks in advance.

  • Assign a class to an answer element/s and then try to remove the tooltips of the answer field/s using that assigned class. e.g.: $(".answerClass").attr('title',''); – Divya Sharma Mar 12 at 13:57
  • Thanks for the reply Divya. I'll give that a try. – Matt Powell Mar 13 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.