These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Reset button needs to clear selected fields, instead of all fields

Wielo2001
Registered: Jan 14 2009
Posts: 28

I have a script that I adapted and assigned to a button in LiveCycle to create a button that will reset all but two selected fields when the user clicks it....
but the script is clearing all the fields in the form, including the ones not named in the script.
I'm hoping there is a simple way to alter the script to retain those two selected fields and reset all the others?

Here is the existing script:
xfa.host.resetData("xfa.form.form1.requestor,xfa.form.form1.computerID,xfa.form.form1.callback,
xfa.form.form1.dept_division,xfa.form.form1.location,xfa.form.form1.desc_brief,
xfa.form.form1.desc_detail,xfa.form.form1.resolution,xfa.form.form1.radio_priority,
xfa.form.form1.chk_dm,xfa.form.form1.chk_acc,xfa.form.form1.chk_copy,xfa.form.form1.chk_ms,
xfa.form.form1.chk_ent,xfa.form.form1.chk_ws,xfa.form.form1.chk_warr,
xfa.form.form1.reviewer,xfa.form.form1.review_notes,xfa.form.form1.Workorder");

My Product Information:
LiveCycle Designer, Windows
suewhitehead
Registered: Jun 3 2008
Posts: 232
Your script looks mostly right,, but you did not say what the names of the fields you did not want reset were. So assuming that they are NOT listed, (that is that they are not xfa.form.form1.requestor, xfa.form.form1.computerID, xfa.form.form1.callback, xfa.form.form1.dept_division, or xfa.form.form1.location), just remove xfa.form from the list and of course add ") at the end.

Also note that ALL of the fields that you want to reset must be listed between the (" and ").

xfa.host.resetData
("xfa.form.form1.requestor,xfa.form.form1.computerID,xfa.form.form1.callback,xfa.form.form1.dept_division,xfa.form.form1.location")
Wielo2001
Registered: Jan 14 2009
Posts: 28
I'm probably not following along here properly... but to clarify, the two fields that are not to be reset are named trainee_student and CurrentDate, and they are not included in the script.

I take it that what you mean by removing xfa.form from the list is to take the that suffix off of each of the items in the list, leaving this:

xfa.host.resetData("form1.requestor,form1.computerID,form1.callback,form1.dept_division,
form1.location,form1.desc_brief,form1.desc_detail,form1.resolution,form1.radio_priority,
form1.chk_dm,form1.chk_acc,form1.chk_copy,form1.chk_ms,form1.chk_ent,form1.chk_ws,
form1.chk_warr,form1.reviewer,form1.review_notes,form1.Workorder");

I tried that, and it still rest all of the fields, including trainee_student and currentDate. I'm guessing that I misunderstood your direction for removing xfa.form, but that is the only place that term exists in the list... ????
suewhitehead
Registered: Jun 3 2008
Posts: 232
No I meant that you should change your script to this:
xfa.host.resetData
("xfa.form.form1.requestor,xfa.form.form1.computerID,xfa.form.form1.callback,xfa.form.form1.dept_division,xfa.form.form1.location")

Possibly you did not copy the entire script correctly when you originally posted or the AcrobatUser post left off some of it or something. But there was xfa.form at the end and no ") showing.

If this does not help, I don 't know what is going on.
Wielo2001
Registered: Jan 14 2009
Posts: 28
My mistake... I didn't notice that the string was getting cut off in the post. I edited the post to show it properly, but of course that still leaves us without a solution. Thanks much for the reply though!