dojo.widget.byId("dp0").inputNode.value = "";

Use at your own risk, you are using Dojo internals there :)

musachy

On 5/2/07, kris16 <[EMAIL PROTECTED]> wrote:


Hi Musachy,
yes that works thanks. But i do not want to set the value to new Date().
I want to set i to "", or erase the text field from the date so to say.
Is that possible ?
/Krister



Musachy Barroso wrote:
>
> You need to call the "setDate(date)" method on the *widget* for the
> datepicker, assuming you have a datepicker with the id "dp0":
>
> dojo.widget.byId("dp0") .setDate(new Date());
>
> musachy
>
> On 5/2/07, kris16 <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi, I am trying to reset the value of a datetimepicker in a jsp page
>> using
>> struts2 (2.0.6).
>>
>> I can not reset the value.
>>
>> See code below.
>> The onchange and the call to the Java script function
(planStatuschanged
>> )
>> seems to work, but the datetimepicker's value is not set to "". If I
use
>> an
>> ordinary input tag (<input ...) instead of a datetimepicker it works.
>>
>> I have tried the dojo.widget.byId("statusDateId").setDate("") method
>> instead
>> of :
>> formObj.statusDateId.value="";
>>
>> But that do not work either.
>> What am I doing wrong ?
>>
>>
>>
>>
>> <s:select onchange="planStatuschanged(document.formular)" ...
>> ...
>> ...
>> id="planStatus"/>
>>
>> <s:datetimepicker id="statusDateId" name="statusDate"
>> label="Planeringsdatum"/>
>>
>>
>> function planStatuschanged (formObj) {
>> if (formObj.planStatus.options[formObj.planStatus.selectedIndex].value
==
>> 4) {
>> formObj.statusDateId.value="";
>>   }
>>
>> }
>> --
>> View this message in context:
>>
http://www.nabble.com/reset-the-value-of-a-datetimepicker-using-java-script-tf3680879.html#a10286861
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
>

--
View this message in context:
http://www.nabble.com/reset-the-value-of-a-datetimepicker-using-java-script-tf3680879.html#a10289469
Sent from the Struts - User mailing list archive at Nabble.com.


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




--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Reply via email to