If Else Statement with Javascript
493904Feb 13 2007 — edited Feb 20 2007I have procedure on the page which uses if and else to calculate a value for a field.
DECLARE
v_Fuel number;
BEGIN
if :P_AA = '21'
then
if :P129_CC < 1001 then v_Fuel := '110';
elsif :P_BB between 1001 and 1300 then v_Fuel := '140';
elsif :P_BB between 1301 and 1600 then v_Fuel := '160';
elsif :P_BB between 1601 and 1900 then v_Fuel := '170';
elsif :P_BB between 1901 and 2200 then v_Fuel := '180';
elsif :P_BB between 2201 and 3000 then v_Fuel := '210';
elsif :P_BB between 3001 and 4000 then v_Fuel := '230';
else v_Fuel := '300';
end if;
elsif :P_AA = '24'
then
if :P_BB < 126 then v_Fuel := '40';
elsif :P_BB between 126 and 450 then v_Fuel := '70';
elsif :P_BB between 451 and 850 then v_Fuel := '90';
else v_Fuel := '110';
end if;
elsif :P_AA = '23'
then
v_Fuel := '0';
end if;
:P_CCC := v_Fuel;
END;
My javascript is pretty basic. How do I write this in javascript so when I tab out of the P_BB field the new value appears in P_CCC.
Cheers
Gus