Tag Info

Hot answers tagged

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


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


2

That's one of the UI issues in SharePoint 2013, that when Enhanced Rich Text is selected the required validation message appears twice. I don't know if there is an update available to fix this (and other issues). But you can try some JS/jQuery to hide one of them.


2

This is known issue with custom forms. Can you try replacing "<SharePoint:FormField" with <SharePoint:ClientPeoplePicker runat="server" ID="MyControlName" Required="true" ValidationEnabled="true" InitialHelpText="text" VisibleSuggestions="3" Rows="1" AllowMultipleEntities="true" CssClass="ms-long ms-spellcheck-true" /> you can also try the ...


2

Create field on list 1 to store value -> Create a workflow so when you create item on List 1, it creates item on list 2. Then waits 1 minute, then updates List 1 with ID from List 2. This way the pause will allow the ID to be generated before attempting to update it. This works if you don't need immediate access to the ID link and can wait 1 minute for it to ...


2

I'm actually fairly sure this isn't possible -- and the reason might seem kind of silly, but is a limitation of the architecture having to deal with content types: Forms (edit/view) are associated with a particular content type; so when you go to a list and edit an item, the first question SharePoint asks before it renders any form is 'what content type is ...


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

Please consider using Virto Form Extender (http://www.virtosoftware.com/products/content-mgmt/virto-ajax-list-form-extender). It is stated that fields visibility can be dynamic on new/edit list item form.


2

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


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

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

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

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

I had this problem because one of my coworkers had tried to customize the master page in SharePoint Designer. The master was already customized, with code, through Visual Studio, so the existence of a detached copy made SharePoint throw a fit since code isn't allowed on pages inside the content database. To fix it, I located the offending master page in ...


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


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

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

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

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

WPQ2FormCtx.ItemContentTypeId will give the content type ID of the item in each of the forms newform.aspx, ediform.aspx and displayform.aspx. You can also use WPQ2FormCtx.ItemContentTypeName, if you want to compare name instead of Id. Here is a JQuery code to hide fields in the forms: <script type="text/javascript"> jQuery(document).ready(function($) ...


1

Just create new forms in Designer and delete what you don't want displayed. Be sure they aren't required fields that aren't answered yet, or you'll get errors, but it's super simple.


1

Open the edit form page in browser and then add a Script Editor Webpart. Edit the Snippet and use below script <script type="text/javascript"> $(document).ready(function(){ var textToAppend = "<b>Text to Insert</b><br/>"; var temp = $('select[Title="Content Type"]').parent().html(); ...


1

I found a Solution for this case. While using the attributes UseDefaultListFormWebPart="FALSE" or UseLegacyForm="TRUE" did not add the default form webpart, SharePoint threw an UnsafeControlException. It looks like the DataFormWebpart on my NewVisitor.aspx could not be used "standalone" this way. The final solution was following: Open ...


1

I was able to use a custom form in place of the default one, without duplicated fields by applying the attribute UseLegacyForm="TRUE" on my custom form registration. In your case that should become: <Forms> <Form UseLegacyForm="TRUE" Type="DisplayForm" Url="DisplayVisitor.aspx" ...


1

From InfoPath Designer Select File menu tab Select SharePoint List template Select Design Form button Enter Site URL Select existing List Select Content Type The new InfoPath Form is now associated with a specific Content Type. https://kerdirks.wordpress.com/2012/10/03/associate-custom-infopath-form-with-list-content-type/


1

You can create standard html form with javascript. You can do with it what you want and write on list using Java Script Object Model on button click or something with javascript. With this approach you can do with the form what you want. On button click you can write item on list and don't close the form, so you can reuse data putting next item on a list. ...


1

Simplest way will be to create a view which shows only those items in which Created By= [Me] or Team Member =[Me] filter. This view will shows only those items which are created by current logged in user or if the training is assigned to that user. So other managers will not see other training which they have not created. Make this view as the default view. ...


1

Yes, this is possible. You can add Last three field in section (Containers). After adding fields in section, add rules to this section to display only when login user is inside a SharePoint user group. You can add data connection having SharePoint user group there. And validate the same using rule applied in section. The blog ...


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



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