Sign in to Community
Sign in to view all badges
I'm using an HTTP button to check fields on a form before submitting. Can anyone help?
Check the total in the description of work table and make sure it’s 100%--return an error if it’s not
Check the other mandatory fields and return an error if they aren’t completed – it’s an XML submit button in LiveCycle so it is currently doing that
Give a “success” message when everything is completed
DO NOT generate an email when everything is OK – just the success message.
Buttons on my form – the one I’m needing help with is check form before submitting
This is how the button is currently set up.
This is the table where I need the total percentage of time to be checked to be sure it’s 100%.
This shows the hierarchy and naming of the table.
Formula for total in table.
Hi, I you retype the quotes in LiveCycle Designer then you will get rid of the MS Word quotes and then syntax wise that line will be fine.
Thanks. The quotes are "" in LiveCycle. I've been working with the code in a Word document, so that's why they pasted over as quotation marks.
My IT environment won't allow me to post the form where others can access it. 😕
The line with the syntax error is:
var oFields = xfa.layout.pageContent(nPage, “field”);
Might be just the forum editor, but this quotes used seem to be the fancy ones like Word uses. Also this line is mucked up;
for (var n=); n<nNodes; N++)
I presume it should be, something like;
for (var n=0; n<nNodes; N++)
Maybe a link to the actual form would be easier.
I tried this for checking the mandatory fields, but I have a syntax error in line 8 and I don't know what it is.
function validateForm ()
var bMsg = false;
//loop through all pages in the form
for (var nPage=0; nPage<xfa.host.numPages; nPage++)
//loop through fields in the page
var nNodes = oFields.length;
//if the field is required
if (oFields.item(n).rawValue==”” ||
bMsg = true;
xfa.hostmessageBox (“At least one required field is empty”);
var oFld = xfa.resolveNode(fld);
if (uiFld == null)
uiFld = oFld.ui.resolveNode(“#choiceList”);
if (uiFld != null) // only handles text field and list box
//restore the original white color
uiFld.border.presence = “visible”;
uiFld.border.fill.color.value = “255, 255, 255”;
function highlightField (fld)
var uiFld = oFld.ui.resolveNode(“#textEdit”);
if (uiFld != null) //only handles text field and list box
uiFld.border.fill.color.value = “255,255,128”;