2

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.

1 Answer 1

3

Change the line

checkbox.prop('checked',false);

to

checkbox.removeAttr('checked');
10
  • Thanks for reply sir, I made changes according to your suggestion but the check box is not getting unchecked. Commented Aug 22, 2013 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 Commented Aug 22, 2013 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 Commented Aug 23, 2013 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 Commented Aug 23, 2013 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 Commented Aug 23, 2013 at 6:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.