Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to send multiple jQuery datepicker values to a database
    primarykey
    data
    text
    <p>I am creating a website that facilitates setting a meeting time for a group of people, very much like <a href="http://whenisgood.net/" rel="nofollow" title="WhenIsGood">WhenIsGood</a>.</p> <p>When creating a new meeting, users start by inputting the dates that a meeting could possibly occur (using a jQuery datepicker with form inputs). The form starts with three fields, but users can add more as needed. My question is, how can I store the date values so that they can be used later? The values will be used again in the meeting creation process when users have to select a time range for each submitted date value. Also, the final tentative schedule (days submitted and time ranges submitted) will need to be made available to group members. I know, this is pretty abstract at the moment, and I'll be more than happy to give more details if necessary. <a href="http://itcs4155.vacau.com/createmeeting.php" rel="nofollow" title="Create Meeting">Here is the page in question</a>.</p> <p>My main concern is figuring out how to store the values without knowing how many values there will be. If anyone could point me in the right direction, I would greatly appreciate it. I have a SQL database that I have set up and am using. I assume the data would be stored there since, you know, it's a database. Or if there's a better way, that's cool too. Thanks in advance.</p> <pre><code>&lt;?php include 'core/init.php'; //protect_page(); include 'includes/overall/header.php'; ?&gt; &lt;form action="sendemail.php" method="post"&gt; &lt;link rel="stylesheet" href="css/jquery-ui.css" /&gt; &lt;script src="js/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script src="js/jquery-ui.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { var count = 4; $(".datepicker").datepicker({ dateFormat: 'yy-mm-dd', minDate: '+0D', numberOfMonths: 2}); $( 'input[type="text"]' ).datepicker(); $("#addDate").click(function(){ $('#dateholder').append('&lt;p&gt;Date: &lt;input id="dp' + count + '" type="text" class="datepicker" /&gt;&lt;/p&gt;'); count++; $(".datepicker").datepicker({ dateFormat: 'yy-mm-dd', minDate: '+0D', numberOfMonths: 2}); $( 'input[type="text"]' ).datepicker(); }); }); &lt;/script&gt; &lt;h1&gt;Create a Meeting&lt;/h1&gt; &lt;div style="display: inline-block; margin-left: 20%;"&gt; &lt;div id="dateholder" style="text-align:center;"&gt; &lt;p&gt;Date: &lt;input id="dp1" type="text" class="datepicker" /&gt;&lt;/p&gt; &lt;p&gt;Date: &lt;input id="dp2" type="text" class="datepicker" /&gt;&lt;/p&gt; &lt;p&gt;Date: &lt;input id="dp3" type="text" class="datepicker" /&gt;&lt;/p&gt; &lt;/div&gt; &lt;div style="text-align:center;"&gt; &lt;p&gt;&lt;input type="button" value="Add Date" id="addDate" /&gt; &lt;input type="submit" value="Submit Dates"/&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;?php include 'includes/overall/footer.php'; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload