Yes, using substrings (or split on the slash and use the array). The
onSelect event only returns a string of the date, so you will need to
use some kind of string manipulation to parse out the pieces.
Something like this (not tested) should do the trick:
var arr_dateText = dateText.split("/");
startmonth = arr_dateText[0];
startday = arr_dateText[1];
startyear = arr_dateText[2];
Hth,
Dave
On May 22, 12:13 pm, melat0nin <[email protected]> wrote:
> Thanks for the reply.
>
> Are you suggesting that I use substrings etc to split up the string?
> I am not sure what you've recommended there!
>
> On May 22, 4:15 pm, Fontzter <[email protected]> wrote:
>
> > $("#datepicker").datepicker({
> > onSelect: function(dateText) {
> > alert("Parse dateText into your variables. dateText = " +
> > dateText);
> > }
>
> > });
>
> > Hth,
>
> > Dave
>
> > On May 22, 10:38 am, melat0nin <[email protected]> wrote:
>
> > > Hi all
>
> > > I'm trying to integrate datepicker into an existing javascript which
> > > has six fields - a day, month and year field for From and To. The
> > > vars are startday, startmonth, startyear and endday, endmonth and
> > > endyear.
>
> > > I'd like Datepicker to split its date into three to populate the three
> > > fields. I've used the altField option but I seem to be able only to
> > > populate one alternative field.
>
> > > Is this possible? Any help would be much appreciated! :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---