Set cursor position after Rules

Forums Dynamic Forms for SharePoint Set cursor position after Rules

Tagged: ,

This topic contains 6 replies, has 3 voices, and was last updated by  Alexander Bautz 1 month, 3 weeks ago.

  • Author
    Posts
  • #19757

    Brett
    Participant

    Hi Alexander,

    Is there a way to position the cursor to a specific field after Rules have been fired?
    I’ve got a bunch of Content Types and a Managed Metadata field which uses the set field value in a rule.

    Once rule is triggered, if I click in an empty text field and click Save all works fine, but if I just click Save I get error:
    “Value cannot be null. Parameter name: Term Id”. (attached)

    If you can please provide a script that can click in a text field after rules are fired, this would help me seal the deal for DFFs SCA license purchase.
    Ask if you need more details?
    Thanks.

    Attachments:
  • #19787

    Brett
    Participant

    Hi Alexander,
    From further testing, are you able to provide a script to click out of the Managed Metadata box from a function in a Rule?
    The last field on the form is this “Doc” Managed Metadata field and it seems to work when I click on anywhere else on the form, then I click Save button.
    I’ve been Googling this and I was leaning towards a jQuery .focusout method, is that right?
    Your help is much appreciated.
    Regards.

  • #19813

    Alexander Bautz
    Keymaster

    Hi,
    You can try adding this to your Custom JS and call the function from the “Run these functions / trigger these rules” in the rule:

    function focusOnTitle(){
        jQuery("#dffs_Title input:text").focus();
    }
  • #19823

    Brett
    Participant

    Thank you Alexander that worked perfectly.
    I also changed it to use the filename column:

    jQuery("#dffs_FileLeafRef input:text").focus();

    SCA license purchase will follow shortly now that my Manager is impressed DFFS could do what Nintex Forms couldn’t.
    Cheers.

    • This reply was modified 9 months, 1 week ago by  Brett.
  • #19838

    Alexander Bautz
    Keymaster

    I’m glad we got it sorted 🙂

    Alexander

  • #22121

    Rick Cedergren
    Participant

    I’m having trouble setting the focus on form load to a people picker field. I tried the function above (as jQuery(“#dffs_Recipient input:text”).focus();) without success. Any thoughts as to why it is not working?

    Thanks in advance.

    • #22177

      Alexander Bautz
      Keymaster

      Hi,
      I think the people picker input in earlier SP versions might actually be a div (with contenteditable property) – use the developer tools to inspect the field and change the selector to target the correct element.

      Alexander

You must be logged in to reply to this topic.