Forums

Value from Checkboxes

Ron 14 May, 2020
Hello,

I have a field of checkboxes as follows:


Field=> name : equipment id: equipment

mm=mm
zz=zz
yy=yy
.....

I used to work okay in form V5 as I used to use custom code for form display now in forms V6 I cannot use. I have to add what ever boxes are checked but I just cannot make it work. The code I used is here..
<?php

if ( isset( $this->data[ 'currency' ] ) && $this->data[ 'currency' ] && $this->data[ 'equipment' ] ) {
$temp = $this->data[ 'currency' ] . '_' . $this->data[ 'equipment' ];
print( "\n {$prices[$temp]}" ); {
$totals += $prices[ $temp ];
}
}
?>
<br>
<?php

if ( isset( $this->data[ 'mm' ] ) && $this->data[ 'mm' ] && $this->data[ 'currency' ] ) {
$temp = $this->data[ 'currency' ] . '_mm';
print( "\n {$prices[$temp]}" ); {
$totals += $prices[ $temp ];
}
}
?>
<br>

<?php

if ( isset( $this->data[ 'zz' ] ) && $this->data[ 'zz' ] && $this->data[ 'currency' ] ) {
$temp = $this->data[ 'currency' ] . '_zz';
print( "\n {$prices[$temp]}" ); {
$totals += $prices[ $temp ];
}
}
?>
<br>

Can I be guided as to how to make it work.. Only the first field works okay.

Please help

Ronn
healyhatman 15 May, 2020
$this->data("fieldname")

function now, not an array
This topic is locked and no more replies can be posted.