I'm having a little issue after submitting my forms. I use this this Javascript to allow clients to enter more then one item at a time before clicking on the submit button
to add another input box until they are done. The client clicks submit and the data is saved it works great up to this point.
When the data is saved it is all save in ONE line in my Database table I need it to be saved as different lines.
Here is my Debug
1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array ( [pudate] => Array ( [0] => 04/23/2011 [1] => 05/01/2011 ) [pucity] => Array ( [0] => Cleveland [1] => Phoenix ) [Submit] => Submit [chronoformname] => aztruckboard )
6. $_FILES Array: Array ( )
7. Form passed the plugins step (if enabled) OK
8. Debug End
Screen of fine results
Thanks for taking a look and maybe helping if its not to late :-)
<script src="/js-scrips/addInput.js" language="Javascript" type="text/javascript"></script>
<form method="POST">
<div id="dynamicInput">
P/U Date<br><input type="text" name="pudate[]"><br>
P/U City<br><input type="text" name="pucity[]">
<input type="submit" name="Submit" value="Submit">
</div>
</br>
<p>
</p>
<br>
<input type="button" value="Add another text input" onClick="addInput('dynamicInput');">
</form>
then that call this script var counter = 1;
var limit = 10;
function addInput(divName){
if (counter == limit) {
alert("You have reached the limit of adding " + counter + " inputs");
}
else {
var newdiv = document.createElement('div');
newdiv.innerHTML = "P/U Date " + (counter + 1) + " <br><input type='text' name='pudate[]'>";
document.getElementById(divName).appendChild(newdiv);
}
{
var newdiv = document.createElement('div');
newdiv.innerHTML = "P/U City " + (counter + 1) + " <br><input type='text' name='pucity[]'>";
document.getElementById(divName).appendChild(newdiv);
counter++;
}
}
to add another input box until they are done. The client clicks submit and the data is saved it works great up to this point.
When the data is saved it is all save in ONE line in my Database table I need it to be saved as different lines.
Here is my Debug
1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array ( [pudate] => Array ( [0] => 04/23/2011 [1] => 05/01/2011 ) [pucity] => Array ( [0] => Cleveland [1] => Phoenix ) [Submit] => Submit [chronoformname] => aztruckboard )
6. $_FILES Array: Array ( )
7. Form passed the plugins step (if enabled) OK
8. Debug End
Screen of fine results
Thanks for taking a look and maybe helping if its not to late :-)