0

Help solve the problem.
There is a form on which there are four radiobatona, 1 week, 2 weeks, 3 and 4.
We chose the mark appeared a table (or tables) with a week. The table consists of days. On each day against the two input (from and to), input can be many. Employees vyberaem himself. There INPUT button that adds and removes. That is, For example:
Monday from 10:00 to 14:00
from 15:00 to 18:00
from 20:00 to 21:00
Tuesday from 10:00 to 17:00
Wednesday, etc.
Any day he might miss.
And the question is how all this data I send to the server and process them.
After a week, input, we obtained dynamic.

Vayas
  • 107
  • 3
  • 11

2 Answers2

0

Though I didn't get you clearly, but you have to set the input up as an array. Example: Assuming Monday button was checked.

<input type="checkbox" name="time[]" value="10:00 to 14:00" />
<input type="checkbox" name="time[]" value="15:00 to 18:00" />
<input type="checkbox" name="time[]" value="20:00 to 21:00" />


print_r($_POST['time']);
jkoech
  • 367
  • 1
  • 10
0

Regarding to: "And the question is how all this data I send to the server and process them."

var formData = $("#myForm").serialize();
$.ajax(...
   type: "POST",
   data: formData,

More;

jQuery -> http://api.jquery.com/serialize/

PHP Arrays -> http://php.net/manual/en/language.types.array.php

Kerem
  • 11,377
  • 5
  • 59
  • 58