There are certain requirements when creating new item in the SharePoint custom list user has to hide certain columns based on other value. There are two different ways to achieve it.
In Client side, it can be achieved using Javascript, especially using the Jquery. I'm big fan of JQuery and I'll be using the second option to achieve it in this blog.
Please have a demo on the below video.
- Server side
- Client side
In Client side, it can be achieved using Javascript, especially using the Jquery. I'm big fan of JQuery and I'll be using the second option to achieve it in this blog.
- Edit the new form and add CEWP to the form
- Change the chrome state to none, we don't want to see the webpart title it's meant to invisible to the end users.
- In the HTML view of the CEWP, add the below code snippet.
- Change the HideColumn funtion parameters based on your columns in the custom list.
Please have a demo on the below video.
Hi Rajesh
ReplyDeleteI am using SharePoint 2010.
I have list A and list B in two webparts, I have connected both webparts using webpart connections.
So when I select the connection link in list A it filters the items in List B baesd on ID.
Now I want to customize list B to restrict end user to add only one item for one ID of list A.
i.e., List A - List B
AID001 - BID001
AID002 - BID002
At the moment I can add one or more items in List B for list A i.e.,
AID001 - BID001, BID002, BID003 ...
So I should be restricted to add only 1 item in list B associated to list A item , once the user add one item in List B then the " Add new item " should disappear.
Any ideas or suggestions.
Thanks