Try this :

var vDate = dojo.widget.byId("validateDate");
vDate.inputNode.value = '2007-01-01';



Andvar Woo wrote:
Thanks for your reply,but the problem still exists: the value do be set--a
alert statement shows
that,but the input box still displays nothing: just a blank,the
datetimepicker does not work either--i cannot select a new date,the dropdown
date-select panel does not appear when click
the date icon.


2000/9/20, Martin Gainty <[EMAIL PROTECTED]>:
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]



------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG Free Edition. Version: 7.5.487 / Virus Database: 269.13.25/1018 - Release Date: 9/19/2007 3:59 PM


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to