Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Reset Button in Form prob.

Avatar

Former Community Member
Hi,



We've bough Adobe Acrobat 8 Pro, I've create a Form whit LiveCycle Designer including a Reset Button but my problem is : I don't want all the field to be reset when Users click on it.



And when I'm on LiveCycle the Palette don't have the Actions Tab like in the Adobe Writer. I've tried to right the Java Script but didn't work...

Need help please!

Alain
12 Replies

Avatar

Former Community Member
Forgot to post my FormCalc script :

xfa.host.resetData("xfa.form.HelpDesk.TicketDate,xfa.form.HelpDesk.TicketTime,xfa.form.HelpDesk.ReportedBy,xfa.form.HelpDesk.UserPhone,xfa.form.HelpDesk.AssignedTo,xfa.form.HelpDesk.StarDate,

xfa.form.HelpDesk.EndTime,xfa.form.HelpDesk.Description,xfa.form.HelpDesk.ChexkBox1[0],xfa.form.HelpDesk.ChexkBox2[0],xfa.form.HelpDesk.ChexkBox1[1],xfa.form.HelpDesk.ChexkBox2[1],

xfa.form.HelpDesk.ChexkBox1[3],xfa.form.HelpDesk.ChexkBox2[2],xfa.form.HelpDesk.ChexkBox1[2],xfa.form.HelpDesk.ChexkBox2[3],xfa.form.HelpDesk.ChexkBox2[4],xfa.form.HelpDesk.ChexkBox2[5],

xfa.form.HelpDesk.TextField5[0],xfa.form.HelpDesk.TextField5[1],xfa.form.HelpDesk.TextField5[2],xfa.form.HelpDesk.TextField5[3],xfa.form.HelpDesk.Resolution,

xfa.form.HelpDesk.TextField8[0],xfa.form.HelpDesk.ChexkBox1[4],xfa.form.HelpDesk.ChexkBox2[6],xfa.form.HelpDesk.ExecutedBy,xfa.form.HelpDesk.DateTimefield3,

xfa.form.HelpDesk.TextField8[3],xfa.form.HelpDesk.TextField8[1],xfa.form.HelpDesk.TextField8[4],xfa.form.HelpDesk.TextField8[2]")



All the field are in except the one I wanna keep.

Tks

Alain

Avatar

Level 7
Have you tried:



xfa.host.resetData( [

"xfa.form.HelpDesk.AssignedTo",

"xfa.form.HelpDesk.ChexkBox1[0]",

"xfa.form.HelpDesk.ChexkBox1[1]",

"xfa.form.HelpDesk.ChexkBox1[2]",

"xfa.form.HelpDesk.ChexkBox1[3]",

"xfa.form.HelpDesk.ChexkBox1[4]",

"xfa.form.HelpDesk.ChexkBox2[0]",

"xfa.form.HelpDesk.ChexkBox2[1]",

"xfa.form.HelpDesk.ChexkBox2[2]",

"xfa.form.HelpDesk.ChexkBox2[3]",

"xfa.form.HelpDesk.ChexkBox2[4]",

"xfa.form.HelpDesk.ChexkBox2[5]",

"xfa.form.HelpDesk.ChexkBox2[6]",

"xfa.form.HelpDesk.DateTimefield3",

"xfa.form.HelpDesk.Description",

"xfa.form.HelpDesk.EndTime",

"xfa.form.HelpDesk.ExecutedBy",

"xfa.form.HelpDesk.ReportedBy",

"xfa.form.HelpDesk.Resolution",

"xfa.form.HelpDesk.StarDate",

"xfa.form.HelpDesk.TextField5[0]",

"xfa.form.HelpDesk.TextField5[1]",

"xfa.form.HelpDesk.TextField5[2]",

"xfa.form.HelpDesk.TextField5[3]",

"xfa.form.HelpDesk.TextField8[0]",

"xfa.form.HelpDesk.TextField8[1]",

"xfa.form.HelpDesk.TextField8[2]",

"xfa.form.HelpDesk.TextField8[3]",

"xfa.form.HelpDesk.TextField8[4]",

"xfa.form.HelpDesk.TicketDate",

"xfa.form.HelpDesk.TicketTime",

"xfa.form.HelpDesk.UserPhone"

] )



The description calls for a list of field names separated by comas. So it would appear each field name is within quotes and each quoted string is separated by a coma. White space makes it easier to read.

Avatar

Level 7
My mistake, as per the example in the Scripting help file of LiveCycle Designer, you have to specify the fully qualified field name. It appears you are missing one of the hierarchical level names. But with seeing the form in LiveCycle Designer, I can not tell which one.



I found the following script in the "LiveCycle Designer Scripting Basics"



var f1 = this.parent.somExpression + ".TextField2" + ",";

var f2 = f1 + this.parent.somExpression + ".DropDownList1" + ",";

var f3 = f2 + this.parent.somExpression + ".NumericField1";

// ...and pass the variable as a parameter.

xfa.host.resetData(f3);



So you should be able to do:



var f1 = ".AssignedTo, ";

var f2 = f1 + this.parent.somExpression + ".ChexkBox1[0], ";

var f3 = f2 + this.parent.somExpression + ".ChexkBox1[1], ";

// and so on

var f32 = f31 + this.parent.somExpression + ".UserPhone";

xfa.host.resetData(f32);

Avatar

Former Community Member
Still ain't working, I've tried this :

xfa.host.resetData(

"xfa.form.helpdesk.AssignedTo,

xfa.form.helpdesk.ChexkBox1[0],

xfa.form.helpdesk.ChexkBox1[1],

xfa.form.helpdesk.ChexkBox1[2],

xfa.form.helpdesk.ChexkBox1[3],

xfa.form.helpdesk.ChexkBox1[4],

xfa.form.helpdesk.ChexkBox2[0],

xfa.form.helpdesk.ChexkBox2[1],

xfa.form.helpdesk.ChexkBox2[2],

xfa.form.helpdesk.ChexkBox2[3],

xfa.form.helpdesk.ChexkBox2[4],

xfa.form.helpdesk.ChexkBox2[5],

xfa.form.helpdesk.ChexkBox2[6],

xfa.form.helpdesk.DateTimefield3,

xfa.form.helpdesk.Description,

xfa.form.helpdesk.EndTime,

xfa.form.helpdesk.ExecutedBy,

xfa.form.helpdesk.ReportedBy,

xfa.form.helpdesk.Resolution,

xfa.form.helpdesk.StarDate,

xfa.form.helpdesk.TextField5[0],

xfa.form.helpdesk.TextField5[1],

xfa.form.helpdesk.TextField5[2],

xfa.form.helpdesk.TextField5[3],

xfa.form.helpdesk.TextField8[0],

xfa.form.helpdesk.TextField8[1],

xfa.form.helpdesk.TextField8[2],

xfa.form.helpdesk.TextField8[3],

xfa.form.helpdesk.TextField8[4],

xfa.form.helpdesk.TicketDate,

xfa.form.helpdesk.TicketTime,

xfa.form.helpdesk.UserPhone")



But the reset button still resetting all. Is it possible to write something like (reset all, execpt that field) ?

Avatar

Level 7
My mistake. The code should read:



var f1 = this.parent.somExpression + ".AssignedTo, ";

var f2 = f1 + this.parent.somExpression + ".ChexkBox1[0], ";

var f3 = f2 + this.parent.somExpression + ".ChexkBox1[1], ";

// and so on

var f32 = f31 + this.parent.somExpression + ".UserPhone";

xfa.host.resetData(f32);



"this.parent.somExpression" will generate the fully qualified reference for the field.

Avatar

Former Community Member
Hi,

I've tried :

var f1 = this.parent.somExpression + ".AssignedTo, ";

var f2 = f1 + this.parent.somExpression + ".ChexkBox1[0], ";

var f3 = f2 + this.parent.somExpression + ".ChexkBox1[1], ";

var f4 = f3 + this.parent.somExpression + ".ChexkBox1[2], ";

var f5 = f4 + this.parent.somExpression + ".ChexkBox1[3], ";

var f6 = f5 + this.parent.somExpression + ".ChexkBox1[4], ";

var f7 = f6 + this.parent.somExpression + ".ChexkBox2[0], ";

var f8 = f7 + this.parent.somExpression + ".ChexkBox2[1], ";

var f9 = f8 + this.parent.somExpression + ".ChexkBox2[2], ";

var f10 = f9 + this.parent.somExpression + ".ChexkBox2[3], ";

var f11 = f10 + this.parent.somExpression + ".ChexkBox2[4], ";

var f12 = f11 + this.parent.somExpression + ".ChexkBox2[5], ";

var f13 = f12 + this.parent.somExpression + ".ChexkBox2[6], ";

var f14 = f13 + this.parent.somExpression + ".DateTimefield3, ";

var f15 = f14 + this.parent.somExpression + ".Description, ";

var f16 = f15 + this.parent.somExpression + ".EndTime, ";

var f17 = f16 + this.parent.somExpression + ".ExecutedBy, ";

var f18 = f17 + this.parent.somExpression + ".ReportedBy, ";

var f19 = f18 + this.parent.somExpression + ".Resolution, ";

var f20 = f19 + this.parent.somExpression + ".StarDate, ";

var f21 = f20 + this.parent.somExpression + ".TextField5[0], ";

var f22 = f21 + this.parent.somExpression + ". TextField5[1], ";

var f23 = f22 + this.parent.somExpression + ". TextField5[2], ";

var f24 = f23 + this.parent.somExpression + ". TextField5[3], ";

var f25 = f24 + this.parent.somExpression + ". TextField8[0], ";

var f26 = f25 + this.parent.somExpression + ". TextField8[1], ";

var f27 = f26 + this.parent.somExpression + ". TextField8[2], ";

var f28 = f27 + this.parent.somExpression + ". TextField8[3], ";

var f29 = f28 + this.parent.somExpression + ". TextField8[4], ";

var f30 = f29 + this.parent.somExpression + ".TicketDate, ";

var f31 = f30 + this.parent.somExpression + ".TicketTime, ";

var f32 = f31 + this.parent.somExpression + ".UserPhone";

xfa.host.resetData(f32);



Still AIN'T WORKING... going nuts ! On a test page, the script is returning a 0 value. And on my form the Reset Button is still resetting all

Avatar

Former Community Member
the sentence is :



var f1 = this.parent.somExpression + ".AssignedTo" + ",";

var f2 = f1 + this.parent.somExpression + ".ChexkBox1[0]" + ",";

var f3 = f2 + this.parent.somExpression + ".ChexkBox1[1]" + ",";

// etc

xfa.host.resetData(f32);



Even like that the reset button is resetting all field.

Avatar

Level 7
Here is a working example. You have to get the fully qualified name exactly correct.



http://forum.planetpdf.com/wb/default.asp?action=9&fid=131&read=59260

Avatar

Former Community Member
I've done this : & still reset everything. My path is good, the only thing that I'm not sure is the ...form1.Page1.ResetButton1::mouseUp: - (FormCalc, client) that comes whe I insert my Reset Button.



----- form1.Page1.ResetButton1::mouseUp: - (FormCalc, client) --------



xfa.host.resetData("form1.Page1.AssignedTo,

form1.Page1.ChexkBox1[0],

form1.Page1.ChexkBox1[1],

form1.Page1.ChexkBox1[2],

form1.Page1.ChexkBox1[3],

form1.Page1.ChexkBox1[4],

form1.Page1.ChexkBox2[0],

form1.Page1.ChexkBox2[1],

form1.Page1.ChexkBox2[2],

form1.Page1.ChexkBox2[3],

form1.Page1.ChexkBox2[4],

form1.Page1.ChexkBox2[5],

form1.Page1.ChexkBox2[6],

form1.Page1.DateTimefield3,

form1.Page1.Description,

form1.Page1.EndTime,

form1.Page1.ExecutedBy,

form1.Page1.ReportedBy,

form1.Page1.Resolution,

form1.Page1.StarDate,

form1.Page1.TextField5[0],

form1.Page1.TextField5[1],

form1.Page1.TextField5[2],

form1.Page1.TextField5[3],

form1.Page1.TextField8[0],

form1.Page1.TextField8[1],

form1.Page1.TextField8[2],

form1.Page1.TextField8[3],

form1.Page1.TextField8[4],

form1.Page1.TicketDate,

form1.Page1.TicketTime,

form1.Page1.UserPhone")

Avatar

Former Community Member
ok got it !



I don't need to insert a real Reset Button, just need to insert a STD Button and past my latest scritp whit MouseUp, and it worked !



----- form1.Page1.Button2::mouseUp: - (FormCalc, client) -------------------------------------------



xfa.host.resetData("form1.Page1.AssignedTo,

form1.Page1.StartDate,

form1.Page1.CheckBox1[0], etc...



form1.Page1.UserPhone")



Tks for help !

Alain

Avatar

Former Community Member
I totally understand your frustration. There are many responses on these forums but none of them describe HOW to customize a script phrase for use in your own form. For those of us that are not versed in the language of Script, we need a FORMULA for customizing our own script. Here is one of the posts i found that i was able to use and it worked.

http://www.adobeforums.com/cgi-bin/webx/.3bc43c8b/0

also please note that while this is only for one object i did try pressing enter after the phrase and typing in the same formula using a different objects name and it worked. So you can use the same button to reset a group of fields.



Hope this helped

Avatar

Level 7
Have you looked at:



http://forum.planetpdf.com/wb/default.asp?action=9&fid=131&read=59260



It shows the code for each button. One has to get the field qualified reference exactly correct.