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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.