- Since you are using a hidden to hold the value, you either need to use that as a Date object on the server side, or in your setDate() function you need to parse it out yourself.Example:
var lDate = sCalendar.getSelectedDates();
selDate.value= lDate.getFullYear() + "-" + lDate.getMonth() + "-" + lDate.getDate();
On 4/17/06, samuel_feynman <samuel_feynman@...> wrote:
Your suggestion worked! THANK YOU!! Here's what I ended up with (in
case any newbie in the future needs to do the same thing):
<form action="/jobs/add" method="POST" name="form"
onsubmit="this.the_date.value = cal1.getSelectedDates()">
<input type="hidden" id="the_date" name="the_date" />
Another Q - I didn't see anything in the docs about formatting the
date. The date currently returns as "Wed Apr 19 2006 00:00:00 GMT-0400
(Eastern Daylight Time)" and I'm wondering if there is a "format date"
option to get it into "YYYY-MM-DD" format?
All the best,
> bjames722 wrote:
> > Hi Marcus,
> > Thanks for the quick reply. I tried the following to no avail -
> > "the_date" is still an empty string on the server side :(
> > <td><input type="hidden" id="the_date" name="the_date" />
> > <div id="cal1Container"></div></td>
> > <td><input name="click" type="submit" value="Add Job"
> > onsubmit="document.getElementById('the_date').value =
> > cal1.getSelectedDates ();" /></td>
> > </form>
> > Thanks,
> > Samuel
> tested it now; i got it to work if i listen to event onclick instead.
> If you use onsubmit I suppose you must put it on the form tag instead.
> And then "this" would work as expected too, I suppose.
> (Replying to list if someone else will get this problem)
> Best regards,
Yahoo! Groups Links
<*> To visit your group on the web, go to:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to: