javascript - Clearing text and checkboxes on spawned PDF page - Stack Overflow

I have a PDF document that I've created which has a large number of text and check boxes on what w

I have a PDF document that I've created which has a large number of text and check boxes on what will start out as a single page.

My ultimate aim is to be able to click a button and have the same page spawned, but with all the text boxes cleared of any text, and all the checkboxes unclicked. It should not affect the other page(s).

I have tried:

Attempt 1

Creating a template page with cleared textboxes / checkboxes. I could then add the following Javascript to a 'new page' object, before then hiding the template page so it was always blank:

var newPage = this.spawnPageFromTemplate({ 
    cTemplate: this.getNthTemplate(0), 
    bRename: true,  
    bOverlay: false
});

For some reason this doesn't create all the textboxes on the new page, so I had to abandon this approach.

Attempt 2

Keeping the first page as the template page and keeping it unhidden. When using the same code above, this now ensures that all text boxes are created for some reason.

However, when the user populates the first page and then spawns another, it will copy whatever text / checkboxes that they put into the first page. I therefore need to add code that removes all of the text boxes / clicked checkboxes, but ONLY for the newly created page (not any others).

I tried the following code, but I am well out of my depth here.

var newPage = this.spawnPageFromTemplate({ 
    cTemplate: this.getNthTemplate(0),  
    bRename: true,  
    bOverlay: false
});

// Get the page's field names and reset based on the prefix
var aNameParts = event.targetName.split(".");
var strPrefix = aNameParts[0] + "." + aNameParts[1];
this.resetForm(strPrefix);

It doesn't work...

Does anyone have any ideas as to how I could get this to work?

Thanks in advance,

Phil

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744147031a4560471.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信