Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to change the behavior of the document library upload form i.e. it should appear unchecked when the user uploads the document in library.

I searched over the internet and found this which seems useful as per my need.

I opened the site in the SharePoint designer and edited default.master master page put the script but not working in my case.

Script is as below under the <Head> section :

<script type="text/javascript"
    src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
    <script language="javascript" type="text/javascript">
    $(document).ready(function()
    {
    var form = $('form');
    if ( form.attr('action').indexOf('E2290DED-2B70-4B33-B3A3-97809B209551') > -1 )
        {
        var checkbox = $('#ctl00_PlaceHolderMain_UploadDocumentSection_ctl03_OverwriteSingle');
        checkbox.prop('checked',false);
        checkbox.parent().hide();
        var multiple = $('#ctl00_PlaceHolderMain_UploadDocumentSection_ctl03_UploadMultipleLink');
        multiple.hide();
        }
    }
);
</script>

What should I do to accomplish this?

Please help.

share|improve this question

1 Answer

up vote 3 down vote accepted

Change the line

checkbox.prop('checked',false);

to

checkbox.removeAttr('checked');
share|improve this answer
 
Thanks for reply sir, I made changes according to your suggestion but the check box is not getting unchecked. –  users1100 Aug 22 at 12:53
 
Verify that you got the right ListId (could get this by going to List Settings and getting the Id from the URL). Maybe try to add an alert inside the If block –  Per Jakobsen Aug 22 at 13:08
 
I am getting the ListId from settings url like this way, is this true? or should I follow other method.? @Per Jakobsen –  users1100 Aug 23 at 4:28
 
That's the right one. By the way you say you modified default.master, is that the one used on your site? Usually it's v4.master. Check 'View Source' of your pages to verify that your JavaScript is included –  Per Jakobsen Aug 23 at 6:08
1  
nightandday.master is usually used for 'Site Master Page' (the first) and v4.master as 'System Master Page' (the second) the upload page uses the System Master Page try changing v4.master –  Per Jakobsen Aug 23 at 6:58
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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