• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Update a textfield after selecting a radio button option

Community Beginner ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

I integrated in a pdf

- two radio buttons which have also their own Javascript

- a new textfield (txt_field)

After clicking

- option 1 the textfield should be updated via Javascript of radio button 1: 

  txt_field="€";

(2) option 2 the textfield should be updated via Javascript of radio button 2:

    txt_field="$;

Result: Nothing happened in the moment

How can I implement this feature?

Thanks for further information!
JuMa

TOPICS
Create PDFs

Views

443

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 11, 2018 Mar 11, 2018

This JavaScript alone can do nothing. Is there more? What does it say in the console?

Votes

Translate

Translate
LEGEND ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

This JavaScript alone can do nothing. Is there more? What does it say in the console?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Hi MVP and others,
,

I tried following lines (as js for a radio button)

app.alert ("Start javascript");     //has been shown

txt_EINHEIT.value="€";                //is not working

app.alert ("Ende javascript");      //has been shown

Who kows that problem?

Regards

JuMa

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

That's not how you access a field. Use the getField method.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 11, 2018 Mar 11, 2018

Copy link to clipboard

Copied

Hello try67,

I use your information in 9 hours. Thanks.

Regards

JuMa

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 12, 2022 Jul 12, 2022

Copy link to clipboard

Copied

LATEST

Hi. Could you explain more about the getField method?

 

In the Radio Button Properties box, I went to Actions. I don't know the best trigger to select: Mouse Enter or Mouse Exit, maybe? The action I selected is "Run a JavaScript."

 

I'm familiar with JavaScripts that link dropdown lists with text fields. I don't know how to link radio buttons to text fields.

 

When I link a dropdown list to a text field, I use:

 

switch (event.value) {

case "A":

this.getField("Text Field").setItems(["A1","A2","A3"]);

break;

case "B":

this.getField("Text Field").setItems(["B1","B2","B3"]);

break;

}

 

How do I adjust this JavaScript to work with a radio button instead of a dropdown list? Where do I put it in the Properties box? What trigger should I select?

 

Thanks for your help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines