0

This code is working in IE browser but not working in Chrome browser what changes should me made to make it compatible on both the browsers

<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
    <script type="text/javascript">
    // Execute the following JavaScript after the page has fully loaded, when it's ".ready"
    $(document).ready(function(){

//Show/hide columns based on Drop Down Selection 
$("select[title='Regional']").change(function() {
if ($("select[title='Regional']").val() != "No") 
{
$('nobr:contains("Document Name")').closest('tr').hide();
} 
else 
{
$('nobr:contains("Document Name")').closest('tr').show();
}
});
});
</script>
0

Add the code below into script editor web part in the new/edit form page.

<script src="//code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
// Execute the following JavaScript after the page has fully loaded, when it's ".ready"
$(function () {
    //Show/hide columns based on Drop Down Selection 
    $("select[title='Regional']").change(function() {
        if($(this).val()!="No"){
            $('nobr:contains("Document Name")').closest('tr').hide();
        }else{
            $('nobr:contains("Document Name")').closest('tr').show();
        }
    });
});
</script>

If it will not work in chrome, please using F12 to check if some error occurs.

enter image description here

If you open the page in chrome in SharePoint modern UI, your code will not works.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.