admin管理员组文章数量:1397058
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
本文标签: javascriptClearing text and checkboxes on spawned PDF pageStack Overflow
版权声明:本文标题:javascript - Clearing text and checkboxes on spawned PDF page - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744147031a2592885.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论