I have a radio button with 4 choices. Once the choice is made I want a dollar figure assigned to a variable. Then I want the variable assigned to a data field.
In Custom Code I have this php code:
The dollar value gets assigned properly (I have tested with an echo) but I cannot get the value assigned to 'ex_test_amt'. Using a debug in Submit shows the ex_test_amt field empty.
I have also tried a js (which I've constructed from various examples) in OnLoad:
Again, using a debug in Submit shows the ex_test_amt field empty.
What am I missing? Why is the variable exhibvalue not being assigned to ex_test_amt.
Thanks.
In Custom Code I have this php code:
<?php
$exhiblevel = $form->data['ex_level'];
if ( $exhiblevel == 'ex_business') {
$ex_level_amt = 185;
} elseif ( $exhiblevel == 'ex_sponsor' ) {
$ex_level_amt = 0;
} elseif ( $exhiblevel == 'ex_non-profit' ) {
$ex_level_amt = 90;
} elseif ( $exhiblevel == 'ex_resource' ) {
$ex_level_amt = 25;
}
$form->data['ex_test_amt']=$ex_level_amt;
?>
The dollar value gets assigned properly (I have tested with an echo) but I cannot get the value assigned to 'ex_test_amt'. Using a debug in Submit shows the ex_test_amt field empty.
I have also tried a js (which I've constructed from various examples) in OnLoad:
window.addEvent('domready', function() {
$('ex_level').addEvent('change', ex_test_amt);
});
//Dropdown values to prices
var exhiblevel = new Array();
exhiblevel["ex_business"]=185;
exhiblevel["ex_sponsor"]=0;
exhiblevel["ex_non-profit"]=90;
exhiblevel["ex_resource"]=25;
function exhibit_total(){
var ex_total = parseInt(exhibvalue);
$('ex_test_amt').value = ex_total;
}
Again, using a debug in Submit shows the ex_test_amt field empty.
What am I missing? Why is the variable exhibvalue not being assigned to ex_test_amt.
Thanks.