24

In SharePoint PreSaveItem function is called when onClick event handler is fired for Save button in List Forms. PreSaveItem function: function PreSaveItem() { if ("function"==typeof(PreSaveAction)) { return PreSaveAction(); } return true; } PreSaveAction function from another hand, allows to override behavior for a Save button. It is ...


19

You can do this by using the SPUtility.js library As example I have created a simple list with: Title (simple text). Country (ChoiceField) [Tunisia, Switzerland, Canada, France, Other] – Other is the default value. City (Simple text). By default the City field is hidden if the Country field value is Other. Every list has three default forms to add, ...


10

You can set it as default from SharePoint Designer 2013 as well. You need to select the form and then it will enable the "Set as default" button control in the Ribbon.


10

Your code should be worked, Just one note If you are using SSL, so you should use the HTTPS JQuery reference. The below code should work <script type="text/javascript"> $(document).ready(function(){ $('nobr:contains("Project Subtype")').closest('tr').hide(); //Show/hide columns based on Drop Down Selection $("...


9

Add the URL of the next form as the &Source=[url] parameter The Source parameter in the URL is where the browser is redirected to after a Form is saved. Open an EditForm and investigate the URL The URL has to be URL encoded (and it needs to be within the SharePoint domain) https://xxx.sharepoint.com/sites/VM/Lists/Tasks/NewForm.aspx ?Source= https%3A%2F%...


8

Please try to use CSR. Step 1: Create a JS file and paste below code. (function () { function registerRenderer() { var ctxForm = {}; ctxForm.Templates = {}; ctxForm.Templates = { Fields : { 'LinkTitle': { //------ Change Hyperlink of LinkTitle View : function (ctx) { ...


7

I just want to add one thing, you should not override PreSaveItem - this is a SharePoint built in function. Instead, like mentioned above - override/create PreSaveAction. But: be sure to remember you may not be the only one doing so. So, the correct way to do it is this, which will call other overrides if existed before your code: __OriginalPreSaveAction =...


7

I am not sure i can understand correctly your question, but it seems to me that you want to submit a form via "original" save button. But would like to do your own code in between. If that's correct, what I usually do is to return 'false' in PreSaveItem. Then do all the things I need to do and then submit form with javascript like this: function ...


7

To create a form that would submit items to multiple lists, you should: Add some elements to your main list form, probably arranging them in a certain way. If those elements aren't related to fields as I suspect from your description, best way to do it would be to leverage OnPostRender CSR event and then use HTML5 selectors or jQuery to insert your HTML ...


7

That is not the internal field name of the SharePoint field, it is how ASP.NET (ASPX pages) gives IDs to the fields when it renders them. You should never rely on those as they keep changing based on other controls on the page. In this case MS has probably pushed an update that has brought in one additional control to the page, causing incremented ID to all ...


6

How about using Content Types? Just define different content types for your list, when someone defines the list of content Type A, it will show the fields you want to show, when they select type B, it will show everything but the field you want hidden and so on. Example: Content Type 1: A, B, C Content Type 2: B, C Content Type 3: C, D, E PS: I'm all in ...


6

If I am not wrong, you need to change the default New & Edit form of your specific list using CSOM. Following is using C# Get your list an Content Types. var specificList = oWebsite.Lists.GetByTitle("SpecificListName"); var specificListContentTypes = specificList.ContentTypes; specificListContentTypes holds all the content type those are being ...


6

You can implement this by creating a Custom New Form and adding the HTML you have already created to this aspx page. This will be bound to the SharePoint List . Each SharePoint List by default has NewForm.aspx,EditForm.aspx and a DisplayForm.aspx. If you open the SharePoint Designer you can view them as below: You can add a new Custom Form and set it as ...


5

Here is the C# version of Anders answer as it was not as straightforward as I would have thought. public static void SetFormJSLink(this SPList list, PAGETYPE formBaseView, string jsLinkUrl) { var file = list.ParentWeb.GetFile(list.Forms[formBaseView].Url); file.CheckOut(); using (var manager = file.GetLimitedWebPartManager(PersonalizationScope....


5

Solution: On custom form i added SharePoint:ClientPeoplePicker control near SP2010 peoplepicker control (Which not have autocomplete), that was hided. Markup to add sharepoint:clientpeoplepicker: <sharepoint:clientpeoplepicker allowemailaddresses="true" allowmultipleentities="true" clientidmode="Static" cssclass="ms-long ms-spellcheck-true" height="...


5

In addition to customizing List Views & Forms via XSLT, with SharePoint 2013 was introduced a Client Side Rendering (CSR) technique. As an introductory please follow this article Introduction to Client Side Rendering in SharePoint 2013. Since CSR is the default rendering mode in SharePoint 2013, I would recommend this approach to customize a New Form ...


5

Yes you can. At least in SharePoint 2013 on-prem First create a new custom form. Go to the list where you want the new form and edit the form in SharePoint Designer. Then create a new form (1), give it a name (2), select which kind of form (3), option to set it als default (4) and click ok (5). Then open the newly created form in advanced mode (right ...


5

You can use queryselector to reach the text inside the div: var textValue = document.querySelector("#allowances div").innerText;


5

You can use Jquery (No need to SPUtility) to a show and hide a field based on your selected value by doing the following : Open your customized new form via the browser. Edit Page . Add web Part > Add Script Editor . Add the following code. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script>...


5

There's a great solution which allows you to build a HTML form for SharePoint lists if you're okay using JavaScript and jQuery. Original solution: http://www.markrackley.net/2013/08/29/easy-custom-layouts-for-default-sharepoint-forms/ Updated this year: http://www.markrackley.net/2017/05/04/customize-your-sharepoint-classic-forms-without-infopath/


4

Yes, there is. In the list go to List Settings > Form Settings and tick "Use the default SharePoint Form". If you keep the option "Delete the InfoPath form from the server" unticked, you can later switch back to the IP form. If you tick that option, it will be gone for good.


4

One way at least is to use this CSS: .ms-formtoolbar { display: none; }


4

What you could to is just create a OOTB custom list, change the Title field to "New Idea" or something relevant and then enable ratings for the list from List Settings > Rating Settings. Enable it to Yes and select Star ratings and voila! Users can now rate the item/idea on a scale of 1-5 stars. If you wanna take it further from there, you could set up a ...


4

I did try to add 100 pixels to the modal dialogs height through jQuery once one of the calendar images are clicked (to open the datepicker) and then disable the jQuery to prevent any more height to be added to the dialog. Then I set the CSS class ms-dialog body to be transparent to make the modal dialog look like it has the initial height. This results in ...


4

Just resolved my issue. I referred to this question's answer and added .attr('onclick', '') This clears the onclick attribute in the html. So my code now looks like this: $(document).ready(function(){ $("table#idAttachmentsTable a").attr('onclick', '').click(function (event) { event.preventDefault(); var url=$(this).attr('...


4

I am assuming that you have Employee list(Parent list) and Access card list (Child list) with lookup column "Employee" from parent list. To force one to one relationship, in child list lookup column, select the option "Enforce Unique Values". This will make sure that only one item added in child list per employee.


4

Maybe you have to request the script on demand, try this in your code: SP.SOD.executeFunc('clientpeoplepicker.js', 'SPClientPeoplePicker', function () { //awesome code in here });


4

As several questions and answers over on StackOverflow point out, not without an additional Javascript widget to convert the <select> control of the drop-down into something else. According to the HTML standard, it is not possible to put <img> elements inside <option> elements.


3

It seems that for JSLink to work on the display/new/edit forms you need to set the JSLink on the webpart used in the forms, not directly on the form itself. The following PowerShell code works for the new form on a blog post and should be easy to adopt to your needs in C#: $web = Get-SPWeb "http://myportal" $file = $web.GetFile("Lists/Posts/NewPost.aspx") $...


3

Using powershell, should be something like: $web = Get-SPWeb http://path/to/web $list = $web.GetList("/server/relative/path/Lists/ListUrl") $list.DefaultDisplayFormUrl = "/server/relative/path/Lists/ListUrl/displayifs.aspx" $list.DefaultEditFormUrl = "/server/relative/path/Lists/ListUrl/editifs.aspx" $list.DefaultNewFormUrl = "/server/relative/path/Lists/...


Only top voted, non community-wiki answers of a minimum length are eligible