Skip to main content
Known Participant
December 19, 2018
Question

Radio Button selection pulling data from one field to another?

  • December 19, 2018
  • 1 reply
  • 728 views

Hi there,

Big thanks to everyone, I already received great help on this forum from technical wizards!

User inputs manually into RentPW (rent per week) i.e, 500, 550, 1000 etc

There is a radio button PaymentType with TWO either-or choices:

Full - Pay everything up front in full

Part - Pay monthly

If the user selects Choice 1, I need the SecureDep field to be populate with: RentPW * 2

If the user selects Choice 2 - I need the SecureDep field to be populated with: RentPW * 6

Is this possible?

Just in case, I have attached the actual form: Dropbox - Test Booking Form.pdf

This topic has been closed for replies.

1 reply

Known Participant
December 19, 2018

I have tried the following but it didn't work :/

var a = this.getField("PaymentType").valueAsString; 
var b = this.getField("Part").valueAsString; 
var c = this.getField("Full").valueAsString;
var RentPW = +getField("RentPW").value;

if (a=="Part") event.value = RentPW * 6; 
else if (a=="Full") event.value = RentPw * 2; 
else event.value = ""; 
try67
Community Expert
Community Expert
December 19, 2018

Are there fields called "Part" and "Full"? If so, what do they have to do with this calculation?

And yes, it's certainly possible to do it.

Known Participant
December 19, 2018

There aren't any fields, Full and Part are just the options or choices that are given to the user.

The radio button group is called PaymentType and the first box checked is called Full and the second box is called Part.

Hope I'm explaining it clearly. I don't understand why my script doesn't work?