background preloader

Form

Facebook Twitter

New SharePoint Calendar Events - Setting a Default duration. Date:September 30th, 2009 Author:Ryan Tags: jQuery, SharePoint, SharePoint Development, Tip Category: General, SharePoint Ideas Comments:15 ; Tristan asked in another post “When a calendar event is being created, I want the end date/time to automatically populate to 1.5 hours after the start date/time.

New SharePoint Calendar Events - Setting a Default duration

Seems simple, but haven’t found a formula for this yet” Sounds like a pretty reasonable suggestion and the Calendar lists NewForm.asx already sets the Start time to the current time – shouldn’t be too hard, right? … Using the Default Value setting You can use formula like (1/24th of a day or 1 hour to the rest of us is 0.04167!) =[Created]+0.04167 But we can’t use the Created/Modified field in the formula for a new record because it doesn’t exist yet. OK, so what if we try and use this in the Default Value column as =Today+0.04167 This will always be ‘Today at 1AM’ rather than ‘Today in exactly 1 hour’ as Today uses 12:00 AM as the time offset. FAIL! JQuery for Everyone: Pre-populate Form Fields. Page Content Power Users often request the ability to pre-populate form fields.

JQuery for Everyone: Pre-populate Form Fields

The most straight-forward approach involves passing form field values in the URL as a query string. A while ago, the SharePoint Designer bloggers posted a solution with POJ (plain old JavaScript). More SharePoint Branding – Customisation using JavaScript – Part 1. Hi all I thought with my last post that involved XSL/XSLT, I’d escape from horrid programming languages and write about more interesting topics but it wasn’t meant to be.

More SharePoint Branding – Customisation using JavaScript – Part 1

This time round I had to delve back into the world of JavaScript – something I swore that I would never do again after a painful encounter back in 2000. (Yep, it’s taken me 8 years to face it again!) But like everything else with SharePoint, by being a ‘specialist‘, you seem to have to use more technologies and IT disciplines than you would think possible. As I progressed writing this article, I realised that I was delving back into branding again and toyed with the idea of making this part 8 of the branding series.

Like a vast majority of my posts, this will also be a mini series. CleverWorkArounds Coffee requirement rating (for Metrosexual web developers): CleverWorkArounds Coffee requirement rating (for the rest of us ): [Quick Navigation: Part 2, Part 3, Part 4, Part 5 and Part 6] The problem in a nutshell The Workaround. Hiding the New Toolbar Button in SharePoint with jQuery - Fear and Loathing. Another quick little fun thing today.

Hiding the New Toolbar Button in SharePoint with jQuery - Fear and Loathing

Many times you might want (need) to hide the “New” button on a list toolbar. You know the one I mean? Why would you want to do such a thing? For example on a project I’m building I actually call the NewForm.aspx page with a querystring because I want to pre-populate my form with some vales. As such, I don’t want users to create new items in a list without these references and since they have to come from another list I’m left with the problem of trying to restrict them from creating new items but still offer them the ability to use the features of the list like alerts, exporting to spreadsheets, etc. Client-Side Programming in Sharepoint # 3. Set Default Values in Sharepoint List Forms (Newform.aspx / Editform.aspx) Some time we need to set default values in shaepoint list form. e.g. there may be some requirement where we need to set person or group field with loggedin user in Newform.aspx.

Client-Side Programming in Sharepoint # 3

We can set default values in list setting page. But, by default at design time, there is no way to set a field based on some calculation. In this article we will see how to set default values for some common fields using javascript at run time. we will set default values for following type of fields - Single line of text Choice Number Person or Group Multiple lines of text Date and Time Currency Yes/No Hyperlink or Picture For this we will use task list on team site.Lets add some additional columns in the task list so it can have fields of above types.The Final list design will look like this - Techno Freak: Through javascript sets the default value of a lookup field identified MOSS 2007. If you’re familiar with them, you may have noticed that in several of the application templates we use a bit of Javascript to set default form values based on the query string.

Techno Freak: Through javascript sets the default value of a lookup field identified MOSS 2007

Because we found this to be useful in many different cases throughout our applications, I wanted to share our method with you guys so that you can include it in the applications you develop. When might you use this? It’s pretty easy to set a field’s default value through the list settings in the browser UI, so why might you need Javascript to set a default field value? The reason is that field default values can only take static values or simple formulae based on the current user or today’s date. If that meets your needs, then I’d definitely recommend sticking with that method. How does it work? In short, we add some Javascript to the page that runs when the body is loaded. Enjoy! // This javascript sets the default value of a lookup field identified// by < // Customize this javascript by replacing < Happy Coding ....

SharePoint 2007 – Hiding fields on NewForm.aspx and EditForm.aspx, the easy way « SharePoint Sherpa. Posted on August 26, 2008 by Scott Wheeler One of the limiting factors in using the default forms (NewForm.aspx, EditForm.aspx) is that there is no obvious way to hide columns from appearing in the form. By default all columns in a list or document library will appear in your forms. After doing quite a bit of research on this I found a fairly easy way to hide fields by using JavaScript within the form pages themselves.

In my research I found several different sets of JavaScript code, but some of the scripts are easier to implement than others. Below I provide the best and most straight forward JavaScript and some simple steps to guide you along. SharePoint 2007: Set Default values for form fields when uploading documents - Windows Live. Situation: customer would like to have the ability to set default values for any metadata site columns (lookup or choice) automatically.

SharePoint 2007: Set Default values for form fields when uploading documents - Windows Live

If Department 1 is uploading documents and they have to select their department name from the metadata columns (content types –> site columns) every time they upload a document then its few more clicks for every document. Instead if you can default the department name during the check-in process, it would reduce number of clicks. add the following code to Documents/Forms/EditForm.aspx (better create a copy of this and set the list form to be this new edit form). add the following jcvascript code to PlaceHolderMain web part zone.

Notice in the code mode=[“Upload”] is used to make sure we are default values only during upload. If the user has already selected a value, it should not be overwritten when editing it. Get or Set value for SharePoint field in NewForm, EditForm and DispForm (Get only in DispForm) « SharePoint JavaScripts. 21.03.2011 Fixed a bug in setFieldValue on “over 20 items single lookup”. 14.06.2010 Updated the function “getFieldvalue” to fix a bug when returning the value for an enhanced rich text column on page load.

Get or Set value for SharePoint field in NewForm, EditForm and DispForm (Get only in DispForm) « SharePoint JavaScripts

Thanks to Kat for finding the bug. This article describes how to get or set the value for all standard SharePoint field types in in NewForm, EditForm and DispForm (Get only in DispForm). This solution is tested in IE8, Firefox 3.6.3. Instructions for getFieldValue The function “getFieldValue” takes four arguments: Passing default values to a SharePoint list’s NewForm.aspx page. « Tautic.com. You may come across the need when working with lists and list items in SharePoint, to allow a default value for a field to be passed via a URL parameter. Before we get started, please note that you will need access to Microsoft Office SharePoint Designer, and full access to your site in order to perform all of the steps outlined below. Also, please be aware that modifying the NewForm.aspx page can be troublesome.