Prevent more than one attachment

Forums Dynamic Forms for SharePoint Prevent more than one attachment

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Alexander Bautz 3 months, 2 weeks ago.

  • Author
    Posts
  • #20667

    Ivan Wilson
    Participant

    Any suggestions on how I can restrict the New and Edit form for a list item to prevent more than one attachment?

  • #20683

    Alexander Bautz
    Keymaster

    I think I have answered something like this before, but cannot find it – maybe it was answered by email.

    What you need to do is to add something like this in your Custom JS:

    setInterval(function(){
    	if(jQuery("#idAttachmentsTable tr").length > 0){
    		spjs.dffs.doReadOnly(["Attachments"]);
        }else{
    		spjs.dffs.undoReadOnly(["Attachments"]);
        }
    },1000);

    I haven’t tested it so it might need some tinkering, but you can try it out.

    Alexander

You must be logged in to reply to this topic.