tags:

views:

66

answers:

1

I am using the following date timepicker of dojo framework on my jsp, i am successfully accessing this value in my action class through beans.

<sx:datetimepicker id="smon" name="start_mon"
    toggleDuration="500" toggleType="explode" value="%{'today'}"
        displayFormat="dd/MM/yyyy"
        cssStyle="margin-top : 15px;
        margin-left: 23px;margin-right: 80px;">
</sx:datetimepicker>

and i want to access its value in java script as follows

var end_mon=document.form1.start_mon.value;

but its giving runtime error on the above line where i am accessing the date value. please help me.

A: 

I got the answer, we can access its value in java script as follows. .

var startMonth=dojo.widget.byId("smon").getValue();

we can access its value by its id, in this case which is "smon".

Jitendra