Copy link to clipboard
Copied
I am trying to do a simple task, but keep running into a brick wall. I need my client to select 1 radio choice out of 3 buttons, and have whatever choice the tic, display in a text boxt at the end of the road, automatically. My radio group is called Payment Date. The 3 choices are: 1st/month, 3rd/month, 10th/month. That is the actual name of my three options too. Whichever chosen needs to appear in the text box as the same wording. I have tried several calcualtion scripts but it only shows the first option. I don't know how to add the other two, so they will show when chosen. Last script attempted below. See pics for details.
var showField = (this.getField("Paymentdate").valueAsString=="Yes")
if (showField) event.target.display = display.visible;
else {event.target.display = display.hidden; event.value = "1st/month";}
Copy link to clipboard
Copied
As mentioned by @PDF Automation Station you need to pay attention to field name.
Also, if yours choices are "1st/month, 3rd/month, 10th/month" there is no "Yes" choice then.
If you wish to 'show' text field and display value from radio button that is selected, use this as custom calculation script of that text field:
var showField = this.getField("Paymentdate").valueAsString;
if(showField !== "Off") {
event.target.display = display.visible;
event.value = showField;}
else {
event.target.display = display.hidden;
event.value = "";}
Copy link to clipboard
Copied
this.getField("Paymentdate").value=="Off"?event.value="":event.value=this.getField("Paymentdate").value;
Your description says the field is called Payment Date, but you called it Paymentdate in your script. Use the correct one with the script above. No need to show/hide the text field.
Copy link to clipboard
Copied
As mentioned by @PDF Automation Station you need to pay attention to field name.
Also, if yours choices are "1st/month, 3rd/month, 10th/month" there is no "Yes" choice then.
If you wish to 'show' text field and display value from radio button that is selected, use this as custom calculation script of that text field:
var showField = this.getField("Paymentdate").valueAsString;
if(showField !== "Off") {
event.target.display = display.visible;
event.value = showField;}
else {
event.target.display = display.hidden;
event.value = "";}
Copy link to clipboard
Copied
That's did not work. When the first button was chosen it enter YES. When chosen the other two left the box blank. Again, I need the box to show, whatever button was chosen. See pics for details.
Copy link to clipboard
Copied
You said your choices were 1st/month, 3rd/month, 10th/month. Change your export values to these and it will work.
Copy link to clipboard
Copied
I did. Just verified my export values are correct. The first radio button works fine. but the second and third button is still showing a blank box., I tried both options, yours as:
this.getField("Paymentdate").value=="Off"?event.value="":event.value=this.getField("Paymentdate").value;
if(showField !== "Off") {
event.target.display = display.visible;
event.value = showField;}
else {
event.target.display = display.hidden;
event.value = "";}
and Nesa's script as:
var showField = this.getField("Paymentdate").valueAsString;
if(showField !== "Off") {
event.target.display = display.visible;
event.value = showField;}
else {
event.target.display = display.hidden;
event.value = "";}
Still the same result. Only 1st box shows correctly.
Copy link to clipboard
Copied
I did. Just verified my export values are correct. The first radio button works fine. but the second and third button is still showing a blank box., I tried both options, your script:
var showField = this.getField("Paymentdate").valueAsString;
if(showField !== "Off") {
event.target.display = display.visible;
event.value = showField;}
else {
event.target.display = display.hidden;
event.value = "";}
And PDF Automation script:
this.getField("Paymentdate").value=="Off"?event.value="":event.value=this.getField("Paymentdate").value;
if(showField !== "Off") {
event.target.display = display.visible;
event.value = showField;}
else {
event.target.display = display.hidden;
event.value = "";}
Still the same result. Only 1st box shows correctly.
Copy link to clipboard
Copied
I did. Just verified my export values are correct. The first radio button works fine. but the second and third button is still showing a blank box., I tried both options, your script:
var showField = this.getField("Paymentdate").valueAsString;
if(showField !== "Off") {
event.target.display = display.visible;
event.value = showField;}
else {
event.target.display = display.hidden;
event.value = "";}
And PDF Automation script:
this.getField("Paymentdate").value=="Off"?event.value="":event.value=this.getField("Paymentdate").value;
if(showField !== "Off") {
event.target.display = display.visible;
event.value = showField;}
else {
event.target.display = display.hidden;
event.value = "";}
Copy link to clipboard
Copied
You don't need to hide anything with my script because if the value is "Off" it won't show anything. If the value is anything else, it will show the export value. You only need this line:
this.getField("Paymentdate").value=="Off"?event.value="":event.value=this.getField("Paymentdate").value;
The rest of the script is going to throw an error because you are mixing both scripts together. Mine does not have a variable named showField. You can set the field to Read only so no one can type in it. If the first one works the others should work but you have to change the field name of Paymentdate.
Copy link to clipboard
Copied
I guess I am not understanding. When using just that script, nore of my radio buttons show anything in my box. all 3 radio buttons leaves a blank response in the box. That's why I added your script to hers. At least the first radio button does right. Whatever I am doing wrong, please show me and advance me the correct script to make this work. I am about to lose this contract because I can't get this script right. Thanks.
Copy link to clipboard
Copied
Your form did not upload properly.
Copy link to clipboard
Copied
This was the correct answer. User error was the issue. I found out that I had a script attached to the other 2nd and 3rd Buttons. That's why they were blank when ticking them. Deleted both of those scripts from the buttons and Viola! It worked for all three choices. You rock, Nesa!! Thanks for assisting me.