Hi folks!
I have been trying for a long time now to find out how to make a form as you can see here:
https://www.dropbox.com/s/93egfvqeq4rnqim/fsk_km2013.pdf
The form needs to calculate how many of 1: and 2: and the user must be allowed to input a time beneath DBU-tid. At the end it must calculate a total.
Is it possible at all?
Thanks a lot :-) !
Michael
I have been trying for a long time now to find out how to make a form as you can see here:
https://www.dropbox.com/s/93egfvqeq4rnqim/fsk_km2013.pdf
The form needs to calculate how many of 1: and 2: and the user must be allowed to input a time beneath DBU-tid. At the end it must calculate a total.
Is it possible at all?
Thanks a lot :-) !
Michael
Hi Michael,
This is certainly possible. How far have you got and exactly what problems are you having?
Bob
This is certainly possible. How far have you got and exactly what problems are you having?
Bob
Hi, Bob!
Thanks a lot for your prompt reply :-) !
Actually not that far :-/
I have been trying to get multiple fields in one line and to find out how to make the calcultations in the form?
Hope you can help ;-)!
Thanks,
Michael
Thanks a lot for your prompt reply :-) !
Actually not that far :-/
I have been trying to get multiple fields in one line and to find out how to make the calcultations in the form?
Hope you can help ;-)!
Thanks,
Michael
Hi Michael,
I'd probably create the rows using PHP in a Custom Code element, and I'd store the data needed to do them in an array to make it easy to edit. Something like this for the Ladies part:
This is not very pretty but should get you started.
Once you have the form working you can use JavaScript to add up the totals to display them in the form, and/or PHP to add them after the form is submitted.
Bob
I'd probably create the rows using PHP in a Custom Code element, and I'd store the data needed to do them in an array to make it easy to edit. Something like this for the Ladies part:
<?php
$dame_data = array();
$dame_data[] = array(
'hold' => 'U7 piger',
'argang' => '06',
'spillere' => '3+2',
'pris' => '200'
);
$dame_data[] = array(
'hold' => 'U8 piger',
'argang' => '05',
'spillere' => '3+2',
'pris' => '200'
);
$dame_data[] = array(
'hold' => 'U9 piger',
'argang' => '04',
'spillere' => '4+3',
'pris' => '250'
);
// and so on
$dame_data[] = array(
'hold' => 'Dame senior',
'argang' => 'fyldt',
'spillere' => '4+2',
'pris' => '370'
);
?>
<table>
<thead>
<tr>
<th>Hold</th>
<th>Argang</th>
<th>Spillere</th>
<th colspan = '2'>Antal hold i niveau</th>
<th>DBU-tid</th>
<th>Pris</th>
</tr>
</thead>
<tbody>
<?php
foreach ( $dame_data as $k => $d ) {
echo "
<tr>
<td>{$d['hold']}</td>
<td>{$d['argang']}</td>
<td>{$d['spillere']}</td>
<td><input type='text' class='' name='antal[$k]' id='antal_{$k}' value='' /></td>
<td><input type='text' class='' name='niveau[$k]' id='niveau_{$k}' value='' /></td>
<td><input type='text' class='cf_time_picker' name='tid[$k]' id='tid_{$k}' value='' /></td>
<td>{$d['pris']}</td>
</td>
";
}
?>
</tbody>
</table>
This is not very pretty but should get you started.
Once you have the form working you can use JavaScript to add up the totals to display them in the form, and/or PHP to add them after the form is submitted.
Bob
This topic is locked and no more replies can be posted.