最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Radio Button Value in pdf (javascript calculation) - Stack Overflow

programmeradmin1浏览0评论

I have a form which I am creating in Adobe Pro.

The "Grandtotal" field is determined by a variety of radio buttons selected.

My first step is to give each of the radio buttons a value.

My set of radio buttons is called "Options" - Radio button 1: "15" Radio button 2: "25"

What javascript could I use to put the value of the selected radio button (either 15 or 25) into my "Grandtotal" field ?

I have tried the following:

var option1 = this.getField("Options");
var option2 = this.getField("Options");

var total = this.getField("Grandtotal").value;
event.value = option1 or option2

Thank you

I have a form which I am creating in Adobe Pro.

The "Grandtotal" field is determined by a variety of radio buttons selected.

My first step is to give each of the radio buttons a value.

My set of radio buttons is called "Options" - Radio button 1: "15" Radio button 2: "25"

What javascript could I use to put the value of the selected radio button (either 15 or 25) into my "Grandtotal" field ?

I have tried the following:

var option1 = this.getField("Options");
var option2 = this.getField("Options");

var total = this.getField("Grandtotal").value;
event.value = option1 or option2

Thank you

Share Improve this question asked Oct 31, 2012 at 20:24 user1426583user1426583 3193 gold badges9 silver badges25 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 1

I don't know the use of Javascript in PDFs, but what I found online, it looks like you should use something like this:

var option1 = this.getField("Options1");  // Get first radio button
var option2 = this.getField("Options2");  // Get second radio button
var total = this.getField("Grandtotal");  // Get grand total textbox

if (option1.checked) {
    total.value = option1.value;
} else if (option2.checked) {
    total.value = option2.value;
}

Now, I'm not sure what you mean by my set of radio buttons is called "Options", because that would mean retrieving the radio button fields might be different.

发布评论

评论列表(0)

  1. 暂无评论