-1

My office is working with LiveCycle ES4 and I'm kinda new to it. I have a form that contains some custom validation javascript which gets called in the submit event of a submit button, which works fine. The form is deployed in Livecycle Workbench, which replaces the in-form submit button with the workbench 'complete' button.

We're running into a problem where if a user enters data in one of the required fields, then clicks the Workbench Complete button, the exit event for that field doesn't fire, which means the rawValue is not set to the value the user entered. So when the validation runs as part of the submit event, it fails, even though the user has entered text in that field.

Is there some way to change this up so it shifts focus out of the current field when clicking the Workspace button?

Stephanie
  • 151
  • 8
  • Please provide code samples where appropriate to make it easier to help you – gareththegeek Dec 05 '14 at 14:45
  • 1
    I would if there were any relevant - but this is about the default behavior of the WorkSpace host, not something the validation scripts are doing. – Stephanie Dec 05 '14 at 16:26

1 Answers1

1

There are ways the ensure that this does not happen. One of the ways to do this is to place an if statement in the submit button code so that the form submission happens only when the rawValue of that field is populated. If the if statement does not evaluate to true, the submit code does not execute and you dont have to worry about this problem. Also, If the field is not populated, your code can also set the focus to that field so that the user is automatically navigated to the field in question.

Hopefully this strategy helps. Please let me know if you have any other questions.

Thanks, Armaghan.

  • 1
    ,thanks for your response. I do have a script in the submit logic that prevents submittal if the required fields don't have a value. The problem is that if the user enters a required field, types in some info, then clicks the WorkBench submit button without tabbing or clicking out of the field, it does not fire the exit event for the field they were in, so the rawValue isn't set before the validation script is run. Therefore, although they typed in some information, the form still tells them that a required field is missing. – Stephanie Dec 05 '14 at 21:48
  • On the submit button code, you can also execute an event of another field (in your case, you can execute the exit event).This way, your exit event will always be executed before the form can be submitted. Here is a reference from Adobe docs. http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm?content=001337.html Hope this helps. – Armaghan Chaudhary Dec 07 '14 at 03:23
  • I did find a way to determine which field is in focus and explicitly call its exit event in the presubmit event for the button. It turns out that workspace actually fires the exit event for the field in question AFTER the submit happens (I know this because I put some xfa alerts in to confirm when each event happened.) So I still haven't solved the problem. – Stephanie Dec 29 '14 at 17:15
  • 1
    That should not be default behaviour. I would log a bug with Adobe on this and follow up with them to get it resolved. – Armaghan Chaudhary Jan 02 '15 at 16:18