Dynamic Forms for SharePoint: Now with support for SharePoint 2013

Change log

May 06. 2013
I have released v2.95 – you find it here

March 19. 2013
v2.81 fixes a bug occurring when you set a boolean column as required.

March 01. 2013
I have released v2.8 with some new features, and a few bugfixes.
New features:

  • Add the ability to insert custom CSS and JavaScript (in the Misc tab)
  • Added “URL Query string parameter” as trigger for a rule.

Bug fixes:

  • Validating an empty lookup column with the text (none) failed. This has been fixed by checking the val() property which will be 0.
  • “showFieldDescriptionWhenReadonly” had a bug preventing it from functioning.
  • If you selected the same field twice in a tab, it misbehaved. I now strip away any duplicates by removing the last occurrence.

IMG
Refer these articles for background information and setup instructions:
Dynamic Forms for SharePoint: Production
Dynamic Forms for SharePoint – Now with Tabs

The Dynamic Forms for SharePoint solution now supports SharePoint 2013. Please note that I have just started looking at SharePoint 2013, and have tested the solution in a “Microsoft Office 365 Developer Preview” only.

There might be issues with a “non office 365” install, but you will have to tell me about it in the comments section below.

The code is shared between SharePoint 2007, SharePoint 2010 and SharePoint 2013.

Changes from v2.65

  • Fixed bug where the tab setup link is missing in initial setup.
  • Added “show field description when readonly” switch under “Misc” section.
  • Added support for SP 2013.
  • Small change to the file default.css to remove form background color in SP 2013 (goes better with the SP 2013 look).
  • Added error handling when using invalid characters in the custom css setup in the heading configuration and including.
  • Added support for rules comparing date columns against other date columns in the form, or validation of empty / not empty date columns.

Setup
The setup for SP 2013 is similar to that for SP 2010. Please note that you need to update spjs-utility.js to use Dynamic Forms for SharePoint v2.7 – not only for SP 2013: get spjs-utility.js here.

See change log where you download spjs-utility.js. For setup instruction, see the first article linked in the top of this article.

Please post any findings below this article.

Please support my work by buying me a beer

PayPal

32 Comments on “Dynamic Forms for SharePoint: Now with support for SharePoint 2013

  1. I have noticed an issue with multiple triggers for setting fields as required.

    I have a list with 3 separate choice columns (yes, no)

    If column 1 choice = yes then column 4 is visible and required

    If column 2 choice = yes then column 5 is visible and required

    If column 3 choice = yes then column 6 is visible and required

    This works except if I select yes for column 1 then yes for column 2 once the trigger runs for column 2 making column 5 required column 4 becomes optional.

    This happens whenever I change column 1, 2 or 3 choices. The rule based on that trigger happens but also previously required (by other rules) columns become optional.

    1. Hi,
      Have you configured the parameter “And these rule indexes are true” to include a check for “Linked rules”?

      Alexander

      1. I have not since there would be a large number of variations I was hoping not to have to account for.

        such as rule 1 & 2
        Rule 3 & 1
        rules 1 & 2 & 3

        and all combinations of the 3

    2. Hi,
      The way the rules work is that the last rule that is triggered is “king”. If you have specified another – linked rule – “the last run status” of this rule is verified, and if both is “true”, the actions under the last rule will be triggered.

      Alexander

  2. After upgrading to v2.70, forms opened in Edit will not close on ‘Save’ click. I am confident that all required fields are complete. Form is multi-tab with rules. I am running SP 2010. On ‘Save’ click, the form looks like it’s saving. Then main form panel goes white. Then main form panel reappears as it looked prior to clicking save. But form should have closed. Cancelling and reopening form shows form did not save. Ideas please…something in 2.70 perhaps or my issue? Thanks.

    1. Hi,
      Press F12 to bring up the developer console (in IE and Chrome – and Firefox if you have Forebug installed). Look at the console for errors.

      Alexander

      1. Thanks Alexander, I opened the console and scrolled through the CSS and script. I did not observe any errors.

        – Jack

      2. Correction…I found the “Console” section and found this error:

        Invalid argument. sp.ui.rte.js?rev=gtvnBQlpiH6heu6RHMsIsA%3D%3D, line 2 character 141793

      3. It was my error. Some People/Group fields were not resolving due to a SP filter change I had made. Sorry for taking your time on this one. Thank you again.

  3. Are there issues with SHarepoint 2013 related to MUI — have a partner translating our products and he can not get the MUI (using 1033, etc) to work with a new Office/365 site (full 2013 look and feel)

    1. Hi,
      I suspect you are missing the variable L_Menu_LCID. I have tested this in my “Microsoft Office 365 Developer Preview”, but this site has the variable – and the MUI switch is working as expected.

      Try adding this code to the top of the file “DynamicFormsForSharePoint_v2.js”:

      if(typeof L_Menu_LCID === "undefined" && typeof g_wsaLCID !== "undefined"){
      	L_Menu_LCID = g_wsaLCID;
      }

      Let me know if this helps.

      Alexander

  4. Hi Alex,

    thanks for your contributions to the community. I am facing a very odd problem: the only feature I use so far, are tabs. I was able to get them working once and everyhing was fine. For some unknown reason there are no tabs anymore, despite being properly configured as far as the setup dialog is concerned.

    The JavaScript console does not log any errors on both, IE and Chrome. I even used the same setting in a completely new site collection to no avail.

    Setup: SP 2013 RTM with IE, Chrome.

    Do you have any ideas what is going on?

    Thanks
    Steve

    1. Hi,
      I have not fully tested this in SP2013 as the only site I have access to is a “Microsoft Office 365 Developer Preview”.

      I’m afraid I cannot tell what could be wrong, but any info you may have on what could be special with your setup might help.

      Could you check the DOM of your page to verify that the placeholder where I insert the tabs indeed exist in the page?

      Alexander

      1. Hi Alex,

        thnanks for your reply. I was able to figure it out: my code overrides the ListFieldIterator which causes your JS to be unable to work correctly with the form itself.

        Since this is a special case I can’t blame you 🙂

        I still have no idea what to do about it, yet. May be this info is of interest to you.

        Thanks
        Steve

  5. Hi Alex,

    I am new to this so forgive me for my ignorance. When you implement a custom css will that modify the way the tabs are shown? Also, how do you implement a custom css?

    Thanks,
    Jarret

  6. I am having a strange issue. It looks like it relates to some of the stuff here but can not quite nail it down. I am running a 2007 farm and I have the tabs working just fine and they are great! My issue is that whenever I I have any type of validation fields that have an error when submitting the form, the rich text fields get wiped out. IE I have a people and group field that is required. If someone places something in there that will not validate then any text that is in the rich text field gets wiped out. I hope this makes sense.

    1. Hi,
      Could this be related to IE 10? I have seen strange behavior with RTE fields in SP2007 when “Compatibility mode” is NOT turned on.

      Try activating the developer console buy hitting F12 and look for errors in the “Console”.

      Alexander

      1. Thanks for the reply. I looked at the code and it was running a very old version so I updated to the latest version and all my issues were solved!

        thanks again

  7. Thanks for the great tools! They have put me miles ahead in one day.
    I have a form with, among other items, 2 multi-line text boxes. One of them is required based on a checkbox in the same form. When using IE9, neither of them stores the text I enter in newform.aspx whether the checkbox is checked or not. Firefox (v. 21.0) stores them fine. Is there a known issue with IE9? If so, is there a workaround?

    Thanks again for your work.

  8. Alexander !!!
    A big thanks for your amazing SharePoint form solution.

    Question: Can i display a specific tab using Url paramter?

    question2 (i am maybe dreaming) Can i get that special tab visible and others hidden?

    Many thanks for your reply and again thank you for your amazing contribution to MOSS

    1. Hi,
      Q1: …/DispForm.aspx?ID=22&sTab=1
      Q2: Add a rule with trigger “URL Query string parameter” and value “hideTabs=yes”. Set “Hidden tabs” for example to “0,2” and use this URL: /DispForm.aspx?ID=22&sTab=1&hideTabs=yes

      Alexander

  9. Hi Alexander,

    Thank you very much for this brilliant add-on.

    Any chance you might conciser enhancing the Dynamic Forms to allow typing in function name in the Set set field value in a format “functionName()”.
    If the trigger fires the given field should take value from the result of the function.

    I have updated the instance of your code as follows:

    Line: 1388 (version 2.95)
    function doSetFieldValue(arr){
    var val, offset;
    if(!isDispForm && arr !== undefined){
    $.each(arr,function(i,obj){
    if(obj.val.charAt(0) === “{“){
    val = buildValStr(obj.val);
    }
    else if(obj.val.toLowerCase().indexOf(“\[today\]”)>-1){
    offset = obj.val.match(/[\-|\+]\d+/)
    if(offset!==null){
    offset = parseInt(offset,10);
    }
    val = getTodayInLocalDateFormat(obj.fin,offset);
    }
    //Michal Golka – allow function names
    else if(obj.val.indexOf(“()”) > 0){
    try {
    val = eval(obj.val);
    }
    catch(ex){
    alert(“Error executing: ” + obj.val + “. ” + ex.message)
    }
    }
    else{
    val = obj.val;
    }
    setFieldValue(obj.fin,val);
    });
    }
    }

  10. Alexander,

    I followed the steps to install DFFS on SharePoint 2013. The admin UI works, but it’s got a few bugs. Tabs missing & rules not being applied. Likely that I’ve used the wrong file somewhere within my DFFS 2013 install. Would it be possible to simply send me all the necessary DFFS files in a zip for SharePoint 2013?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.