<?php
$options = array(
500 => 500,
1000 => 1000,
2500 => 2500,
5000 => 5000,
);
echo form_dropdown('units',$options);
?>
$db_num = 25; # a random number
$post_num = $set_num * (units-selected)
how do i get multiply the selected value of of the units dropdown with my $db_num
when submit is clicked? I think this may need javascript but is it possible without?
On my controller I tried this:
$db_num = $this->input->post('db_num');
$units = $this->input->post('units');
$answer = $db_num * $units;
...
echo $answer;
(result is no error and no insert. What am I doing wrong?)