Andvar-
Date date = new Date("Sat, 01 Jan 2007 13:30:00 GMT");
and then once you acquire the id call setDate as in
dojo.byId(id).setDate(date);
courtesy of a posting by musachy
http://mail-archives.apache.org/mod_mbox/struts-user/200705.mbox/[EMAIL
PROTECTED]
HTH/
M--
----- Original Message -----
From: "Andvar Woo" <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Wednesday, September 19, 2007 10:13 PM
Subject: set value of the datetimepicker but the value does not appear in
the input box
hi all,
i want to set the value of a datetimepicker in javasript but encounter
a problem. i do that like this: first use ajax to
get a record as a "json" object,then use the "json" object to initialize a
form, which contains a datetimepicker.
the form is used to add a new record and to modify a select record.
the main code is as follows
//the datetimepicker i want to set value,the <s:head theme="ajax"/> is
included in the head tags.
<s:datetimepicker id="validateDate" label="Validate Date"
name="blacklist.validateDate" displayFormat="yyyy-MM-dd" />
//the js to set value of datetimepicker
function modify()
{
var vDate = dojo.widget.byId("validateDate");
vDate.setValue('2007-01-01');
alert(vDate.getValue());
}
the value do be set because the 'alert(vDate.getValue())' shows the value
'2007-01-01',the problem is the input box of the datetimepicker displays
nothing,and i couldnot select a new date either,something like the
datetimepicker is disabled,(<s:head theme="ajax"/> is included in the head
tags,the datetimepicker works well when add a record in the form)
does anyone knows how to handle this problem?
many thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]