Hello veryone!
I have made a RequestForQuote form, in which I give the possebility to add new positions to get RFQ'ed.
In basics this is quite easy done via PHP in my case. Work realy fine. You may want to have a look. It is to be found at: my website
Now I got infected with the jquery-virus and simply wanted to add the datepicker ui (for the latest version I got from their webpage).
<input type="text" size="10" id="deldate[]
class="datepicker" value="<?php echo $_REQUEST['deldate'][$k]; ?>" />
$k is from a php for($k=0;$k<=$NoPos;$k++)
loop
the javascript code work is like:
$(function() {
$('input').filter('.datepicker').datepicker({
showOn: 'button',
buttonImage: 'calender/media/cal.gif',
buttonImageOnly: true,
firstDay: 1,
dateFormat: 'yy-mm-dd',
minDate: 0, maxDate: '+4Y'});
});
An in the browswer it looks quite nice, the ui shows up, I cann select a date.
BUT...
if I add another position to the form, which is done via PHP, so I have to submit the form to count $NoPos up, the formerly inersted date(s) is lost and I have a blank input-field.
now with the
onSubmit: function(dateText)
I can get the selected date. However I am failing in accessing the correct input field to put the date in.
So my question is simple: What am I doing wrong? If evrything is fine then someone would please please tell me how I can solve this..
I have thougth of something such as:
for (var i=0;i<=NoPos;i++) {
var tag = "#deldate"+i;
$(tag).datepicker({ ... });
}
and using php to <input type="text" size="10" id="lieferdat<?php echo $k; ?>" class="datepicker" />
Many thanks for your assumed patience to read through this...
and many more thanks for any hints given
Cheers Daniel