Hallo,
I have made a form (my first form) with addRow function.

de code
PHP Code:
<?php require "db.php";
$query= "SELECT * FROM taallessen ORDER BY taalnaam ASC"; $res = mysql_query($query) or die(mysql_error()); $lesdata = ""; while ($row = mysql_fetch_row($res)){ if ($lesdata) $lesdata .= ","; $lesdata .= '"'.$row[1].'"'; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Join now</title> <link href="main.css" type="text/css" rel="stylesheet"> </head>
<script language="JavaScript"> function del_formrow(){ if (!this.table_formcontainer) this.table_formcontainer = document.getElementById("table_formcontainer");
if (!this.table_formcontainer) return;
var table_formcontainer = document.getElementById("table_formcontainer") if (table_formcontainer.rows.length > 1) { table_formcontainer.deleteRow(table_formcontainer.rows.length-1); } table_formcontainer.deleteRow(); }
function add_formrow(){ if (!this.table_formcontainer) this.table_formcontainer = document.getElementById("table_formcontainer");
if (!this.table_formcontainer) return;
var new_row = table_formcontainer.insertRow(-1); var new_cell1 = new_row.insertCell(0); var new_cell2 = new_row.insertCell(1); var new_cell3 = new_row.insertCell(2);
var new_input1 = document.createElement("input"); new_input1.type = "text"; new_input1.size = "40"; new_input1.name = "kidername[]"; new_cell1.appendChild(new_input1); var new_input2 = document.createElement("input"); new_input2.type = "text"; new_input2.size = "5"; new_input2.name = "age[]"; new_cell2.appendChild(new_input2);
var new_input3 = document.createElement("select"); new_input3.name="lesson[]"; var options = [<?php echo $lesdata; ?>] ; for (var i = 0; i < options.length; i++) { var option = document.createElement("option"); option.value = options[i]; option.text= options[i]; try { new_input3.add(option, null); } catch(error) { new_input3.add(option); } } new_cell3.appendChild(new_input3); } </script> <body> <div id="credit"><b>T e s t</b></div> <br> <form name="data" method="post" action="confirmation.php" onSubmit="return validate(this);"> <fieldset> <legend> <font color="blue"><b>Kid informations</b></font></legend><br> <table id="table_formcontainer"> <tr bgcolor="#e5e5e5"> <td width="200"> Kidname </td> <td width="20"> Age </td> <td width="80"> Lesson </td> </tr> <tr> <td><input name="kidname[]" size="40"></td> <td><input name="age[]" size="5"></td> <td><select name="lesson[]"><option value="select">select</option><option>Chines</option> <option>German</option><option>France</option><option>English</option><option>Italian</option> <option>Nederlands</option><option>Spain</option></select></td> </tr> </table> <table> <tr> <td width="500" align="right">[<b><a href="#" onclick='add_formrow();'>+</a></b>]</td> <td> </td><td>[<b><a href="#" onclick='del_formrow();'>-</a></b>]</td> </tr> </table> <br> <fieldset> <legend> <font color="blue"><b>Parent informations</b></font></legend><br> <table> <tr> <td width="100">Name</td> <td>:</td> <td><input name="naam" size="50"></td> </tr> <tr> <td width="100">Address</td> <td>:</td> <td><input name="adres" size="50"></td> </tr> <tr> <td width="100">Zip</td> <td>:</td> <td><input name="postcode" size="50"></td> </tr> <tr> <td width="100">City</td> <td>:</td> <td><input name="woonplaats" size="50"></td> </tr> <tr> <td width="100">Phone</td> <td>:</td> <td><input name="telefoon" size="50"></td> </tr> <tr> <td width="100">Email</td> <td>:</td> <td><input name="email" size="50"></td> </tr> </table> <table> <tr> <td width="100"> </td> <td> </td> <td><br><input type="submit" name="submit" value=" C o n f i r m "> <input type="button" value=" R e s e t " onclick="reset()"></td> </tr> </table> </form></fieldset>
<br> </body> </html>
How to send this form to my email? perhaps in php.
perhaps someone can help me. thanks in advance
Last edited by blueskin; 01-14-2009 at 11:30 AM..
|