1

Currently I am working with Document Library in SharePoint 13. When uploading the document, I need the users to choose an Option from pretty Long drop-down list in one of library columns (currently it is in radio-buttons view so that the users can see all the available Options).

This drop down contains Product categories and sub-categories. Something like:

  • SMARTPHONES
  • Apple
  • Samsung
  • READERS
  • Amazion Kindle
  • Ritmix

Well, the Point is that now users may choose SMARTPHONES and READERS however I want them to be unable to choose them since I Need only brand Name.

Is there some way to remove choice Buttons from these Options? so that users still could see categories Name and then choose brand.

If it is easier, try to perceive it as Country-City match in one Dropdown but users should not be available to choose Country.

I would also appreciate some easy solution : non-code and non SP designer since they are locked. And I am not familiar with InfoPath...

Kind Regards

0

Can't think of a solution without using some amount of coding. An elegant way to handle your requirement is to get Product Types from one list, Product Names from another list (which is linked to Product Types) and use cascading dropdowns.

There is some code involved but you don't need to code yourself and no SPD/Infopath required. link

Just add this code into a Script Editor webpart and update field names. It needs little bit more time compared to what you are trying to do but would give a nice user experience.

  • I tested it; it worked fine! thank you very much! my college is going to implement but still in my case i want users to see all the available Options... – intern Mar 2 '16 at 9:30
0

Yes, you do need some coding

But its 2016 (and even Microsoft no longer supports IE9), we have modern HTML5 browsers
so loading jQuery is the 😢 stone-age solution...

  • Add a CEWP or SEWP at the bottom of your Form and the <script> code :

    document.querySelectorAll("option").forEach(function(option){
      option.disabled = option.value==option.value.toUpperCase();
    });
    
  • This picks up all <option> tags From the existing Form
    (that's why you have to add the CEWP at the bottom of the page)

  • loops over all of them
  • sets the disabled attribute on the option Tag to true for option values that are all UPPERCASE

If thats a bit brutal because it applies to all OPTION tags, you could hardcode:

option.disabled = ['SMARTPHONES','READERS'].indexOf( option.value ) > -1;

PS. To add WebParts to Forms WITHOUT Designer: (but you still need the correct edit rights!)

  • Open the Form Page
  • add toolpaneview=2 to the url
  • Okay, I am very dummy in SP so please can you tell me where insert this <script>? – intern Mar 1 '16 at 15:42
  • Unfortunately, this does not work. I saved the code in a text file in SiteAssets and called the text file via the Content Editor Webpart which I placed after Document Upload Form... Th code appeared as a text after form. Or I understnad your proposal wrong? @DannyEngelman – intern Mar 2 '16 at 9:21
  • You can not hit the ball out of the park until you learn how to swing. First learn how to properly add code to a SharePoint page: youtube.com/results?search_query=kalmstorm+javascript – Danny '365CSI' Engelman Mar 2 '16 at 9:33
  • thanks for a good tutorial! okay, I added the script code now it is not displayed as text but seems that still UPPER CASE Options are available for choice – intern Mar 2 '16 at 10:56

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.