Hot answers tagged

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 ...


5

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


3

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 ...


3

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 ...


3

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= ...


3

SharePoint 2013 is using Client Side Rendering by default, so form controls are rendered on client side on some other internal javascript events. It is possible that jQuery.ready() handler is firing too early while controls are not rendered yet and that could be main problem. My suggestion would be not to use jQuery.ready, where normal jsLink with CSR ...


3

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 ...


2

Hey I recommend you to create a webpart with the form as you like and insert the details into your custom list where you don't need to expose your list to anybody. Let me know if you have any questions.


2

In your custom form use Client Side Rendering and render the desired people picker column with the default template, i.e. SPClientPeoplePickerCSRTemplate. This will automatically render your column as you desire. Source


2

You can make that column required by going to List Settings and clicking on to the column, and then just clicking option Yes under "Required that this columns contains information". If you are using sharepoint Forms, then I think you need to create again the new form if you are making changes on the list after creating the new form. That changes will get ...


2

I added the following snippet: <td class="ms-formbody"> <SharePoint:FormField runat="server" ID="field_name" controlMode="Edit" FieldName="Name" /> </td> I don't know why but the FieldName attribute should be the exact displayed name (and NOT the internal name) of the column we want to display.


1

You can do something like this: function click(){ flag = formValidation(); // call function first to return values if(flag == 1){ alert('Your new request has been submitted successfully'); }else{ // some alert } } function formValidation(){ // validate fields here // something like if(val == ''){ ...


1

Use PreSaveAction() function PreSaveAction() { var MyNumber = $('input[title="My Number"]').val(); if( MyNumber == 0 ) { return false; //dont save } return true; //save } http://social.technet.microsoft.com/wiki/contents/articles/31330.sharepoint-using-presaveaction-function-on-custom-list-forms.aspx


1

What you need to do is create a new Edit form, not create a new New form. You can reuse all the Edit form markup from the original Edit form from the list, but you will have to add some custom codebehind to override the Save mechanism. I've found that these 2 blog posts describe quite well how to do this; given they describe it for a custom Display form, ...


1

Then you don't need some fancy javascript to load in values etc. You may bash on JavaScript all you want; it is the preferred solution here from an End-User point of view because he/she triggers the cloning in the Browser. You have to let go of the old-school SharePoint back-end approach and poplulating controls. All you have to do is create a new item ...


1

Not sure how related this can be, but we have seen some SharePoint updates changing way internal fields are named and shown in final HTML output. Here is a case where 'Required Field' is appended to internal display name of mandatory field. http://code2care.org/2015/sharepoint-update-append-required-field-to-display-name-of-mandatory-columns/


1

That depends on how you build your ASPX page. If this is one off page - use SharePoint Designer. Create new pages as needed for the library, remove the default markup and replace with your own. You can search for how to do this and get a lot of examples. Once you have your page - you can manipulate the template directly (via XSL) or use the Client Side ...


1

There are a few different ways I can think of to handle this, based on what I think you described. Created your fields - and then just create a custom list view that doesn't show those column. Your fields will be visible in the edit form. Use InfoPath - with InfoPath you can have fields tied to XML that never populate in the list (this if for InfoPath ...


1

Though I am not sure if Farm solutions can be used so I can provide you with a workaround with the help of workflows. Break permission of the list and give users Add permission. HR group can have any permission you like. On item creation on the list start a workflow which gives HR users the desired permission and remove everybody else permission. This way ...


1

Following is the way to achieve this requirement Create one document library with "ItemID" field Add one hyperlink field to your actual list to store PDF url Create one word document with placeholder 3.1. You need to enable "Developer Tools" in word. Follow this link to do so 3.2. Design your document exactly same as your display form and add "TextBox ...


1

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" ...


1

I needed a simple method to determine if there was at least on error in a form field on any of the tabs. Because ms-error is present in the DOM before an error has occurred (people picker), I had to find a different way. Also, because different fields render the error message in different ways, I had to account for all methods in my form. What I ended up ...


1

Check out this threads. http://spjsblog.com/2012/02/24/form-field-tooltip-for-sharepoint-2007-and-sharepoint-2010/ You'll have to modify add/new/edit forms of the list or document library you are working with. Then you can use any of the numerous tooltip js libraries i.e. http://jqueryui.com/tooltip/ to add tooltips to your form.


1

You can also add a js file using content editor web part and add the below code in it: ExecuteOrDelayUntilScriptLoaded(init,'sp.js'); function init(){ // perform functionalities here }


1

I was getting same issue before. Content type hub is not sync quickly it takes some time to take effect. So i am doing updates programmatically for all site collections.


1

Use javascript by adding a Content Editor to the page or adding it to the markup itself. I did something similar, picked up ContactId from Query String. Picked up this code from here <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script type="text/javascript"> ...


1

By "unsightly HTML" do you perhaps mean something like this? <nobr><span><a href="/yoursite/_layouts/userdisp.aspx?ID=1">Some User</a><img border="0" height="1" width="3" src="/_layouts/images/blank.gif"/><a href='javascript:;' onclick='IMNImageOnClick(event);return false;' class='ms-imnlink'><img name='imnmark' ...



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