Forums

default radio value from form data

NickOg 08 Aug, 2014
Hi all,

I can' see a solution to this in the forum. I must be missing something.😲 πŸ™„

I want to set the default value for the radio control to a value passed to that form. The attached may explain the problem more easily.

The value $form->data['paidBy'] is in the form and I have added <?php $form->data['paidBy'];?> and variants on that echo and so on all to no avail.

What have I missed?
[attachment=0]4Chrono00.png[/attachment]
[attachment=1]4Chrono01.png[/attachment]
GreyHead 09 Aug, 2014
Answer
Hi Nick,

You need to set the value of the entry in the $form->data[''] array. If the passed variable and the form input have the same name it will work automatically, in your case the names are different so you have to add some code. In the form On Load event add Custom Code action with code like this:
<?php
$form->data['inprdoPayBy'] = $form->data['paidBy'];
?>

Bob
NickOg 12 Aug, 2014
Thanks Bob
This topic is locked and no more replies can be posted.