Answered
I can clear a form OK but please do you have a suggestion for code that targets just one page of a series of forms.
I can clear a form OK but please do you have a suggestion for code that targets just one page of a series of forms.
var iPage = 0; // This is your page number, it is 0-based, so page 1 is 0var aFields = new Array(); // array of fields names that are foundvar fNumFields = this.numFields; // number of fields on formvar sFieldName; // sting for field namevar sPageLoc; // string of page or pages field located onfor(x = 0; x < this.numFields; x++) {sFieldName = this.getNthFieldName(x); // get field name for i fieldoField = this.getField(sFieldName); // get field object// test for single occurance of a fieldif(typeof oField.page == 'number')sPageLoc = oField.page.toString(); // convert number to string // test for multiple occurance of a field if(typeof oField.page == 'object')sPageLoc = oField.page; // convert array to string // some debugging helpconsole.println(sFieldName + ': ' + oField.value + ' appears on page: ' + oField.page);console.println(typeof oField.page)console.println('pages on:' + sPageLoc);console.println('match to page number: ' + sPageLoc.indexOf(iPage))// end of debugging help if( sPageLoc.indexOf(iPage) > -1)aFields[aFields.length] = sFieldName;}if(aFields.length > 0)this.resetForm(aFields);
var iPage = 0; // This is your page number, it is 0-based, so page 1 is 0var sFields = new Array();for(var x=0;x<numFields;x++) {var pg = getField(getNthFieldName(x)).page;if((typeof pg == 'number' && pg == iPage) || (typeof pg != 'number' && pg.indexOf(iPage) > -1))sFields[sFields.length] = getNthFieldName(x);}if(sFields.length > 0)resetForm(sFields);
Or something like that...
Jim Healy
FormRouter, Inc.
Check out our FREE Advanced Acroform Toolset:
http://www.formrouter.com/tools
Jim Healy, Founder & CEO FormRouter Inc.
Chapter Leader AUG RTP NC
http://www.formrouter.com