What script/code will make data appear in a cell when a radio button is selected?

Avatar

Avatar

jacob1011

Avatar

jacob1011

jacob1011

13-10-2015

https://nccer.box.com/s/ave99z5oq3avkixem9o13tdpjpyds156

When a customer chooses if they want their order expedited (see hyperlink above for document) they will choose an appropriate radio button to designate that choice. In return, I want their choice of radio button to input a value into the cell labeled "Expedite Fee."

What and which script is necessary for this action? I'm very new to javascript and formcalc.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

_Bruce_Robertson

MVP

Avatar

_Bruce_Robertson

MVP

_Bruce_Robertson
MVP

13-10-2015

Hi,

Try this FormCalc in the calculate event of the Expedite Fee field (that is topmostSubform.Page1.Table1.Row14.Cell5::calculate - (FormCalc, client));

Choose(RadioButtonList[1], 0, 50, 35)

Regular, Overnight and 2nd-day return 1, 2 or 3 respectively, in the Choose function that will return the first, second, or third argument.

It might help read your code later if you give your fields a meaningful name, so RadioButtonList[1] could be renamed Shipping and then the code would be Choose(Shipping, 0, 50, 35)

Regards

Bruce

Answers (2)

Answers (2)

Avatar

Avatar

_Bruce_Robertson

MVP

Avatar

_Bruce_Robertson

MVP

_Bruce_Robertson
MVP

14-10-2015

Hi,

Try this FormCalc in the calculate event of the Shipping & Handling field (that is topmostSubform.Page1.Table1.Row13.Cell5)

if ( Within(Row12.Cell5, 0.01, 19.99) ) then 11

elseif ( Within(Row12.Cell5, 20, 39.99) ) then 15

elseif ( Within(Row12.Cell5, 40, 79.99) ) then 17.95

elseif ( Within(Row12.Cell5, 80, 99.99) ) then 19.95

elseif ( Within(Row12.Cell5, 100, 149.99) ) then 22.5

elseif ( Within(Row12.Cell5, 150, 199.99) ) then 23.5

elseif ( Within(Row12.Cell5, 200, 249.99) ) then 24.5

elseif ( Row12.Cell5 > 250 ) then Row12.Cell5 * 0.1 endif

Regards

Bruce

Avatar

Avatar

jacob1011

Avatar

jacob1011

jacob1011

14-10-2015

Worked perfectly! Thanks so much!

Can you also help me with the formcalc script for making a value in the cell "Shipping & Handling" appear when the subtotal falls within set limits? I have a table above my order table that details the order subtotal amount and the shipping and handling fees that would incur. I'm thinking I need some kind of inequality?

I appreciate your help so much!

Thanks in advance!!