Trying to overcome a JavaScript error in pdf
Copy link to clipboard
Copied
So as I mentioned in my subject... I'm receiving a warning javascript window error: stating "Invalid date/time: Please ensure that the date/time exists. Field [ArrestFile.1.Person.DOA] should match format yyyy/mm/dd". I tried changing the format but it says the same thing. Not sure how to overcome this?
I'm trying to make a field become disabled once you click a radio button.
This is the code that was already existing:
ClearRelated(event.target,this.getField("ArrestFile.1.Content.FullYN"));
ClearRelated(event.target,this.getField("ArrestFile.1.Content.PartialYN"));
ClearRelated(event.target,this.getField("ArrestFile.1.Person.DOA"));
I added this:
ResetPartialDOA(this.getField("ArrestFile.1.Content.PartialYN"),this.getField("ArrestFile.1.Content.PartialDesc"),this.getField("ArrestFile.1.Person.DOA"));
After adding this line of code I get the error.
Also how do I become better in troubleshooting as well as creating code so I don't have to rely this heavily on help?
Thanks for any!
Copy link to clipboard
Copied
Can you post the ClearRelated function script?
Copy link to clipboard
Copied
You need to share the full code, and/or the actual file. It's impossible to help without seeing the contents of those functions you're using, but the result is they are applying an incorrect value to your field. I would actually remove the Format setting from it, so you could see what value is applied to it. The formatting can be taken care of by the script you're using.
Copy link to clipboard
Copied
I'm working from .pdf. Hope the following helps?
function ClearRelated(obj1,obj2,permVisible)
{
//console.print1n("obj1.name: "+obj1.value);
//console.print1n("obj2.name: "+obj2value);
obj2.value=((obj1.value!=="Off")
?(()=>{
obj2.display=((!permVisible)?display.hidden:display.visible);
return "Off";
})()
:(()=>{
obj2.display=display.visible;
return obj2.value;
})());
}
Mind you I am trying to accomplish this in .pdf pro.
- Properties Java Script (Entire Row Col)
OLD:
ClearRelated(event.target,this.getField("ArrestFile.1.Content.FullYN"));
ClearRelated(event.target,this.getField("ArrestFile.1.Content.PartialYN"));
ResetPartialDOA(this.getField("ArrestFile.1.Content.PartialYN"),this.getField("ArrestFile.1.Content.PartialDesc");
NEW:
ClearRelated(event.target,this.getField("ArrestFile.1.Content.DOA"));
ClearRelated(event.target,this.getField("ArrestFile.1.Content.FullYN"));
ClearRelated(event.target,this.getField("ArrestFile.1.Content.PartialYN"));
ResetPartialDOA(this.getField("ArrestFile.1.Content.PartialYN"),this.getField("ArrestFile.1.Content.PartialDesc"));
lmk if it doesn't
Copy link to clipboard
Copied
To expand on this request assuming this helps. Here is the entire line of code:
Entire Record Code:
function ClearRelated(obj1,obj2,permVisible)
{
//console.print1n("obj1.name: "+obj1.value);
//console.print1n("obj2.name: "+obj2value);
obj2.value=((obj1.value!=="Off")
?(()=>{
obj2.display=((!permVisible)?display.hidden:display.visible);
return "Off";
})()
:(()=>{
obj2.display=display.visible;
return obj2.value;
})());
}
Mind you I am trying to accomplish this in .pdf pro.
- Properties Java Script (Entire Row Col)
OLD:
ClearRelated(event.target,this.getField("ArrestFile.1.Content.FullYN"));
ClearRelated(event.target,this.getField("ArrestFile.1.Content.PartialYN"));
ResetPartialDOA(this.getField("ArrestFile.1.Content.PartialYN"),this.getField("ArrestFile.1.Content.PartialDesc");
NEW:
ClearRelated(event.target,this.getField("ArrestFile.1.Content.DOA"));
ClearRelated(event.target,this.getField("ArrestFile.1.Content.FullYN"));
ClearRelated(event.target,this.getField("ArrestFile.1.Content.PartialYN"));
ResetPartialDOA(this.getField("ArrestFile.1.Content.PartialYN"),this.getField("ArrestFile.1.Content.PartialDesc"));
Copy link to clipboard
Copied
This is not sufficient. You must share the FULL code, or the file.
Copy link to clipboard
Copied
I so wish I could give you the file, unfortunately I'm unable to because I don't have the capability nor can I copy & paste. Did some digging and went into the JavaScript Editor. I tried to be as accurate as possible trying to transcribe this code through typing it out with all characters & proper spacing.
Hope this suffices?
//------------------------------------------------------------------
//-----------------Do not edit the XML tags-----------------
//------------------------------------------------------------------
//<Document-Level>
//<ACRO_source>ClearRelated</ACRO_source>
//<ACRO_script>
/************** belongs to: Document-Level:ClearRelated **************/
function ClearRelated(obj1,obj2,permVisible)
{
//console.print1n("obj1.name: "+obj1.value);
//console.print1n("obj2.name: "+obj2.value);
obj2.value=((obj1.value!=="Off")
?(()=>{
obj2.display=((!permVisible)?display.hidden:display.visible);
return "Off";
}) ()
: ( ()=>{
obj2.display=display.visible;
return obj2.value;
}) () );
}
//</ACRO_script>
//</Document-Level>
//<Document-Level>
//<ACRO_source>Reset.PartialDOA</ACRO_source>
//<ACRO_script>
/************** belongs to: Document-Level:ResetPartialDOA **********/
function ResetPartialDOA(obj1,obj2)
{
console.print1n("obj1.name: "+obj1.value);
console.print1n("obj2.name: "+obj2.value);
console.print1n("this.getField(“RequestType.Seal”).name+ ”: ” + this.getField(“RequestType.Seal”).value);
obj2.display=((obj1.value===“Off”?) l l (this.getField(“RequestType.Seal”).value!==“Off“))
?(()=>{
obj2.value=””;
return display.hidden;
}) ()
: ( ()=>{
obj2.value= obj2.value;
return display.visible;
})();
}
//<ACRO_script>
//<Document-Level>
//<Document-Level>
//<ACRO_source>SetPubDate</ACRO_source>
//<ACRO_script>
/************** belongs to: Document-Level:SetPubDate *************/
function SetPubDate()
{
var pubDate=this.info.FormRevision;
var pubDateFld=event.name===“Format”?event:this.getField(“DocPubDate”);
if (pubDate&&(pubDateFld.value!==pubDate)) {
pubDateFld.value=pubDate;
console.print1n(“Set PubDate: ” + pubDateFld.value);
}
}
//<ACRO_script>
//<Document-Level>
//<Document-Level>
//<ACRO_source>ToggleAllRelated</ACRO_source>
//<ACRO_script>
/************** belongs to: Document-Level:ToggleAllRelated ********/
function ToggleAllRelated(numRows)
{
for(var i=1;i<=numRows;i++){
var obj1=this.getField(“ArrestFile.”+i+”.Content.PartialYN”);
var obj2=this.getField(“ArrestFile.”+i+”.Content.PartialDesc”);
//console.print1n(obj2.name);
ResetPartialDOA(obj1,obj2);
}
}
//<ACRO_script>
//<Document-Level>
//<Document-Actions>
//<ACRO_source>Document Will Save</ACRO_source>
//<ACRO_script>
/************** belongs to: Document-Actions:Document Will Save ********/
SetPubDate();
//</ACRO_script>
//</Document-Actions>
//</AcroForm>
//<ACRO_source>ArrestFile.1.Content.EntireRecordYN:Annot1:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/************** belongs to: AcroForm:ArrestFile.1.Content.EntireRecordYN:Annot1:MouseUp:Action1 ********/
ClearRelated(event.target,this.getField("ArrestFile.1.Content.FullYN"));
ClearRelated(event.target,this.getField("ArrestFile.1.Content.PartialYN"));
ResetPartialDOA(this.getField("ArrestFile.1.Content.PartialYN"), this.getField("ArrestFile.1.Content.PartialDesc"), this.getField("ArrestFile.1.Person.DOA"));
//</ACRO_script>
//</AcroForm>
//<AcroForm>
//<ACRO_source>ArrestFile.1.Content.FullYN:Annot1:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/************** belongs to: AcroForm:ArrestFile.1.Content.FullYN:Annot1:MouseUp:Action1 **************/
ClearRelated(event.target,this.getField("ArrestFile.1.Content.EntireRecordYN"));
ClearRelated(event.target,this.getField("ArrestFile.1.Content.PartialYN"));
ResetPartialDOA(this.getField("ArrestFile.1.Content.PartialYN"), this.getField("ArrestFile.1.Content.PartialDesc"));
//<ACRO_script>
//<AcroForm>
//<AcroForm>
//<ACRO_source>ArrestFile.1.Content.PartialYN:Annot1:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/************** belongs to: AcroForm:ArrestFile.1.Content.PartialYN:Annot1:MouseUp:Action1 **************/
ClearRelated(event.target,this.getField("ArrestFile.1.Content.EntireRecordYN"));
ClearRelated(event.target,this.getField("ArrestFile.1.Content.PartialYN"));
ResetPartialDOA(this.getField("ArrestFile.1.Content.PartialYN"), this.getField("ArrestFile.1.Content.PartialDesc"));
//</ACRO_script>
//</AcroForm>
//<AcroForm>
//<ACRO_source>ArrestFile.10.Content.EntireRecordYN:Annot1:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/************** belongs to: AcroForm:ArrestFile.10.Content.FullYN:Annot1:MouseUp:Action1 *************/
ClearRelated(event.target,this.getField("ArrestFile.10.Content.EntireRecordYN"));
ClearRelated(event.target,this.getField("ArrestFile.10.Content.PartialYN"));
ResetPartialDOA(this.getField("ArrestFile.10.Content.PartialYN"), this.getField("ArrestFile.10.Content.PartialDesc"));
//</ACRO_script>
//</AcroForm>
//<AcroForm>
//<ACRO_source>ArrestFile.10.Content.PartialYN:Annot1:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/************** belongs to: AcroForm:ArrestFile.10.Content.PartialYN:Annot1:MouseUp:Action1 *************/
ClearRelated(event.target,this.getField("ArrestFile.10.Content.EntireRecordYN"));
ClearRelated(event.target,this.getField("ArrestFile.10.Content.FullYN"));
ResetPartialDOA(this.getField("ArrestFile.10.Content.PartialYN"), this.getField("ArrestFile.10.Content.PartialDesc"));
//</ACRO_script>
//</AcroForm>
//<AcroForm>
//<ACRO_source>ArrestFile.10.Content.PartialYN:Annot1:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/************** belongs to: AcroForm:ArrestFile.10.Content.PartialYN:Annot1:MouseUp:Action1 *************/
ClearRelated(event.target,this.getField("ArrestFile.10.Content.EntireRecordYN"));
ClearRelated(event.target,this.getField("ArrestFile.10.Content.FullYN"));
ResetPartialDOA(this.getField("ArrestFile.10.Content.PartialYN"), this.getField("ArrestFile.10.Content.PartialDesc"));
//</ACRO_script>
//</AcroForm>
//<AcroForm>
//<ACRO_source>ArrestFile.11.Content.EntireRecordYN:Annot1:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/************** belongs to: AcroForm:ArrestFile.11.Content.EntireRecordYN:Annot1:MouseUp:Action1 *************/
ClearRelated(event.target,this.getField("ArrestFile.11.Content.FullYN"));
ClearRelated(event.target,this.getField("ArrestFile.11.Content.PartialYN"));
ResetPartialDOA(this.getField("ArrestFile.11.Content.PartialYN"), this.getField("ArrestFile.11.Content.PartialDesc"));
//</ACRO_script>
//</AcroForm>
//<AcroForm>
//<ACRO_source>ArrestFile.11.Content.EntireRecordYN:Annot1:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/************** belongs to: AcroForm:ArrestFile.11.Content.EntireRecordYN:Annot1:MouseUp:Action1 *************/
ClearRelated(event.target,this.getField("ArrestFile.11.Content.FullYN"));
ClearRelated(event.target,this.getField("ArrestFile.11.Content.PartialYN"));
ResetPartialDOA(this.getField("ArrestFile.11.Content.PartialYN"), this.getField("ArrestFile.11.Content.PartialDesc"));
//</ACRO_script>
//</AcroForm>
//<AcroForm>
//<ACRO_source>ArrestFile.11.Content.FullYN:Annot1:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/************** belongs to: AcroForm:ArrestFile.11.Content.FullYN:Annot1:MouseUp:Action1 *************/
ClearRelated(event.target,this.getField("ArrestFile.11.Content.FullYN"));
ClearRelated(event.target,this.getField("ArrestFile.11.Content.PartialYN"));
ResetPartialDOA(this.getField("ArrestFile.11.Content.PartialYN"), this.getField("ArrestFile.11.Content.PartialDesc"));
//</ACRO_script>
//</AcroForm>
- Here's most of it... its a table & is redundant until #21 with 3 sections as you see above. Do you need every single syllable?
thanks for your help & happy new years if we don't get to chat until then.

