Tag Info

Hot answers tagged

6

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


5

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


4

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


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

in your page make sure there is no reference to core.css.... issue is due to masterpage which has that reference that the page your using could be referencing the masterpage. several methods: 1) if its referencing a masterpage than make a custom masterpage that is almost the same only that it doesnt contain the core.css reference. 2) within your css add ...


3

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


2

It turns out to be my fault. I was using absolute url for the DisplayFormUrl property, when I changed it to relative url (/_layout/WorkflowTaskForm.aspx), everything works just fine. (so the code snippet in my question works)


2

If you're new to SharePoint development, I can understand your struggling to understand its development model. Responding to UI events by "calling C# code" is possible only with custom webparts or application pages, as no inline-code is allowed in SharePoint Designer by default. You should really first try to determine if what you think will require C# code ...


2

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


2

I can think of 2 possible ways to achieve this: Create a separate Web Part with your form only, and add that web part in the same page as the XsltListViewWebPart. Create a custom Web Part in Visual Studio that has both the form AND the XsltListViewWebPart. You can override the CreateChildControls (and other methods) to have both components coexisting in ...


2

I usually do an <xsl:value-of select="substring-after(@YourField, ';#')" /> I believe. You might need to adjust the ;# part but as I recall, the lookup field value is returned like 1;#Name. So in you example (had to edit your post to see it) it would be like: <div id="Artikelnaam"><xsl:value-of select="substring-after(@Artikelen, ';#')" ...


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

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


1

I would use Knockout JS to bind your inputs and jQuery to submit/create SPList items. here is an example of knockout dynamic row binding: http://knockoutjs.com/examples/gridEditor.html Personally i try to stay away from SPServices and rather use OOB JavaScript api's. Infopath is almost dead, i wouldn't invest my time creating forms etc with it.


1

When I have experienced this error, it's usually do to invalid XSLT in the web part. Something as simple as leaving off a quote or a backslash will result in this error when loading your page. Sometimes I even have to blow away the web part and start over because I can't find anything wrong after staring at the code. But when I do find the problem, it's ...


1

Alex, You should set the control as follow: MyCustomField.ItemFieldValue = "1"; MyCustomField.Field.DefaultValue = "1"; Where 1 is for true, and 0 is for false


1

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


1

How to find ContentTypeChoice control in SharePoint:ChangeContentType control: DropDownList dropDownList = (DropDownList) control.TemplateContainer.FindControl("ContentTypeChoice");


1

You need to set the Inherits attribute to False and then manually include all of the columns.


1

How about relying on the Source querystring instead? Here is a crude example of what I'm getting at: (function(w) { w.PreSaveAction = function() { return w.confirm('Have you been working on it?'); }; var source = '/sites/dev/SitePages/Home%20Page.aspx'; var loc = w.location; var s = loc.search; if (s.indexOf(source) >= 0) return; ...


1

Cant you just add an extra column where it asks the user to enter a text/number/character of any type, and then add an event handler on ItemAdding that checks if the specific field is matching what you asks for and then let the event continue, else cancels the event? Or do the same in your custom webpart with a regular expression. Regular Expressions ...


1

Since you are coming from Windows Forms environment, I will tell you that Visual Studio way is the bestest way (AFAIK).. Since in Windows Forms you have Forms objects, similarly in SharePoint if you create Visual Web Parts; you have ascx files of the User Controls on which you can drag and drop controls and also you can write Page Events or Control Events ...


1

You said you have a FLAG column in your list and that you have multiple edit forms and you are looking for a way to discern which edit form actually caused the editing. You can achieve your goal by adding a <asp:HiddenField> to each edit form, and setting its Value to the value you want the flag to have. <asp:HiddenField runat="server" ...


1

Seems like this has caused a fair bit of angst amongst the dev community working with SP Online and far greater minds than mine have devoted blog posts to the whys and wherefores, but the change is real and here to stay - on the grounds of accessibility for screen readers etc. etc. There's a couple of ways I got around this: Firstly you could change your ...


1

Have a look here on MSDN. I think FormUrls can be of help in your case. This schema enables you to specify client-side redirects to different Display, Edit, and New form pages for items of this content type.


1

I've been fighting this for days. There is a limit of 70 fields in a custom edit form, and this includes Attachment, Modified, Modified By, Created, Created By. I'm in SP2010, but the issue is also in 2013. Reference the book SharePoint Designer 2010 Unleashed by Hughes, p1329. You can get around this by editing for form in InfoPath if you have enterprise ...


1

Under the "Supporting Files" tab, make sure "Content type specific forms:" is set to "Item" not "Folder."


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

It depends on what you want to do. For example the SPServices jQuery library by Marc Anderson, downloadable from CodePlex, has a multitude of commands and manipulations for forms. It's not done with server side code, but purely with jQuery. Another option, if you have the Enterprise license, is to use InfoPath to customise list forms. InfoPath list forms ...


1

SharePoint 2013 workflows allow looping, why not try a workflow that will start if a course changes, and then have it loop through the registration list and update any item that is linked to the course. In my experience, the closer you get to out of the box, the less headaches.



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