Hi
I am struggelig with one form I try to create.
Tryed to solve this with multi page form.
Page1: Fill inn the name and Event
Page2: If name and event is not in the database, the user have to fill in birth year+mail+gender
Page3: Has a list from the database in the top, and the user can fill inn more rows, and the user chould also delete rows....
When user press "Save Row" the form submitt, and goes back to page3, so the user can put in a new row. When user is finish the user press "Finiched" button and an epost is sendt.
I struggle with the delete
and the end/finish to go to send epost.
Here is the JS code:
and here is the php for the table in the top of page3:
Please help.
I am struggelig with one form I try to create.
Tryed to solve this with multi page form.
Page1: Fill inn the name and Event
Page2: If name and event is not in the database, the user have to fill in birth year+mail+gender
Page3: Has a list from the database in the top, and the user can fill inn more rows, and the user chould also delete rows....
When user press "Save Row" the form submitt, and goes back to page3, so the user can put in a new row. When user is finish the user press "Finiched" button and an epost is sendt.
I struggle with the delete
and the end/finish to go to send epost.
Here is the JS code:
window.addEvent('domready', function() {
// add code that needs the dom loaded inside this function
$('Finish').addEvent('click', function(){
alert('OK!');
});
$('Delete').addEvent('click', function(){
<?php
$db =& JFactory::getDBO();
$query = "delete from `Stevne_Registrering` where `input_stevne` = '$detail[input_stevne]' and `input_navn` = '$detail[input_navn]' and `input_svomme_nr` = '$detail[input_svomme_nr]';";
$db->setQuery($query);
$data = $db->query();
?>
});
});
and here is the php for the table in the top of page3:
<table width="100%" border="1" cellpadding="1" cellspacing="1">
<tr>
<th width="15%" scope="col">Øvelse Nr</th>
<th width="40%" scope="col">Øvelse</th>
<th width="20%" scope="col">PåmeldingsTid</th>
<th width="20%" scope="col"></th>
</tr>
<?php
foreach($form->data['StevneReg4'] as $detail):
?>
<tr>
<td><?php echo $detail['input_svomme_nr']; ?></td>
<td><?php echo $detail['input_svomme_art']; ?></td>
<td><?php echo $detail['input_svomme_tid']; ?></td>
<td><input type="button" value="Delete" id="Delete"></td>
</tr>
<?php
endforeach;
?>
</table>
Please help.