I want to add a button that results in a specific field being cleared or reset in my form without it actually resetting the whole form. I have dabbled with with some script but it seems to rest the whole form.
For example I have a group of fields in page 3 where the user selects a course units from a drop down menu (i.e.DropDownList1, DropDownList2 etc..). I want to put a button beside this group of fields so they can reset the field group. In saying this I need to know how to group the 5 fields together so the 'clear' button clears that group of fields.
In you answer can you also indicate with of the selection in the "Show" drop down menu I need to select. E.g. is it click, mouseup, mousedown, etc...
You need to publish/share the file on Acrobat.com.
Until you do this, I can't access the file.
The link to the doc is
Investigation, Compliance and Enforcement Training Systems.
Please consider the environment before printing this e-mail
This e-mail and its attachments are intended for the named addressee only and no liability is accepted for use or reliance on any part of this e-mail by any other person. It is confidential, may be subject to privilege and is also subject to copyright. No part of it should be reproduced, adapted or communicated without the written consent of the copyright owner. Any confidentiality or privilege is not waived or lost because this e-mail has been received by you if you are not the intended recipient.
If you upload it to a file sharing site, like Acrobat.com and then either post the published URL here or PM me.
Man I am thinking I am entering the scripting retard categories
Am I able to email you the form to look at so we are on the same page. No problem if this is asking a bit much. The button I want to add the script to is one page 3 and is titled "reset electives"
From another post, it looks like you are trying to reset five dropdowns. Is that correct?
Forms developed in LC Designer use a Scripting Object Model. What this means is that you access objects on the form using SOM Expressions. You can specify a relative SOM Expression, which is the path from the button to the dropdown. if they were in the same subform/page, then it would look like this:
But if they were separated by a subform the relative SOM Expression could look like this:
The other type of expression is an absolute SOM Expression. This is a reference that is fully stated from the XFA root node, for example:
Generally when you are scripting relative SOM Expressions are perfectly adequate. But in building up the resetData string, I am using somExpression to give the absolute SOM Expression for each object.
I am working up an example demonstrating SOM Expressions. It is DRAFT and unfinished, but it might help. It currently only contains two examples and no supporting text. When I have it finished I will put it up on our website. I would appreciate any feedback you have:
Back to the script.
// reset dropdowns only
var f1 = dropdown1.somExpression + ", ";
var f2 = f1 + dropdown2.somExpression + ", ";
var f3 = f2 + dropdown3.somExpression + ", ";
var f4 = f3 + dropdown4.somExpression + ", ";
var f5 = f4 + dropdown5.somExpression;
Hope that helps. Come back if you are still having trouble.
I am only new to scripting. Can you provide some more simpler instructions for the following.
I want to clear all the fields on a specific page with a button without clearing entire form.
1. Do I need to somehow group the fields on that page together.
2. What would be the script type to clear those fields on that page
3. What selection in the "Show" drop down field should I use to enter that script.
You can use the xfa.host.resetData(); method.
This resets the whole form. If you want to specify specific fields, then you can build up a string of references and then specify this in the command.
// reset page 6 only
var f1 = Table1.Row1.description.somExpression + ", ";
var f2 = f1 + Table1.Row1.quantity.somExpression + ", ";
var f3 = f2 + Table1.Row1.unitPrice.somExpression + ", ";
var f4 = f3 + positionedSF.myName.somExpression + ", ";
var f5 = f4 + positionedSF.myAddress.somExpression;
You can see this in action here: http://assure.ly/gBJYj9, Table 5.
Hope that helps,