Jump to content

cycle through posts generated by javascript


dadamssg87

Recommended Posts

I have developed a calendar app. You can add events to certain days, edit, delete them, etc. It works fine now but I'm trying to improve the adding event section. I would like to be able to have a form where there are "name_of_event" and "description" inputs and then display a input that would have a date-picker. I also want to have a link/button that says something to the effect of "add additional day" and then tie a javascript function to it so when it is clicked another date-picker input will pop up under the first, and they'll be able to add as many additional days as they like. I can't figure out how to write the php code that will cycle through only the date-picker inputs though. Something like the following

 

<?php
$name = $_POST['name_of_event'];
$description = $_POST['description'];

foreach(datepicker_inputs as $date)// <-- part i need help with
{
mysql_query("INSERT INTO Events (name, description, event_date) VALUES ($name, $description, $date)");
}
?>

 

anybody have ideas on how i can only cycle through the date inputs? I'm pretty sure i'm going to have the date input form name something like "date_1", "date_2", etc.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.