Hi everybody !
I'm new here, i've used CHRONOFORM a few days ago. i have a problem , please help me !
- I have a table caculation (4 fields) : a (type : float ) , b(type:float), c( type:float),d(type : varchar)
the problem is : " c =a/b .
if c < 10 -> d= "good".
10 < c < 20 ->d= "bad"
c > 20 -> d="verybad".
i use CHRONOFORM to create a form to input data to my table caculation. i only input data for 2 fields :a and b.the data of c and d will be caculated automatically."
Please help me ! Be clearly please !
I'm new here, i've used CHRONOFORM a few days ago. i have a problem , please help me !
- I have a table caculation (4 fields) : a (type : float ) , b(type:float), c( type:float),d(type : varchar)
the problem is : " c =a/b .
if c < 10 -> d= "good".
10 < c < 20 ->d= "bad"
c > 20 -> d="verybad".
i use CHRONOFORM to create a form to input data to my table caculation. i only input data for 2 fields :a and b.the data of c and d will be caculated automatically."
Please help me ! Be clearly please !
Hi tony,
you can use this
put the code above in the onSubmit after email code box, set the Autogenerated code to run After email too and then go to the "Run order" tab and make sure the Auto generated run order is higher than the onsubmit!
Cheers
Max
you can use this
$newC = C calculation here;
JRequest::setVar("c", $newC);
put the code above in the onSubmit after email code box, set the Autogenerated code to run After email too and then go to the "Run order" tab and make sure the Auto generated run order is higher than the onsubmit!
Cheers
Max
HI, i cannot understand. please show me clearly ! How i do it ? i think i have to create a procedure MySQL, but i cannot do this.
please help me !
please help me !
Hi Tony,
You do **not** need a MySQL procedure for this.
1) add two hidden fields in your Form HTML for c & d
2) In the OnSubmit after code calculate the values:
Bob
You do **not** need a MySQL procedure for this.
1) add two hidden fields in your Form HTML for c & d
<input type='hidden' name='c' value='' />
<input type='hidden' name='d' value='' />
2) In the OnSubmit after code calculate the values:
<?php
$a = JRequest::getFloat('a', '', 'post');
$b = JRequest::getFloat('b', '', 'post');
$c = $a/$b;
JRequest::setVar('c', $c);
if ( $c < 10 ) {
$d = "good";
} elseif ( $c > 20) {
$d="verybad";
} else {
$d = "bad";
}
JRequest::setVar('d', $d);
?>
Bob
I have created a form with chronoform such as your advice.
I pasted your code in onSubmit code - after sending email . is it true ?
when i entered the data , i saw the data of field c and field d on my table is empty .
Please help me .
I pasted your code in onSubmit code - after sending email . is it true ?
when i entered the data , i saw the data of field c and field d on my table is empty .
Please help me .
Hi GreyHead !
I did this successfully . thank you very much to your advice .
I did this successfully . thank you very much to your advice .
This topic is locked and no more replies can be posted.