date control

Hi,

I was using a date control(Date Input), but i am unable to read the value of this control using javascript.

I tried with
var dob = CAF.model(‘#{activePageBean.clientIds[‘date’]}’).getValue();

but it is not working…

is there any other solution…???

Regards,
Sunil_N

Hi,

Have any one tried that…?

Regards,
Sunil_N

Hi Sunil,
yes, I have tried that and it works…

var myDate = CAF.model('#{activePageBean.clientIds['date']}').getValue(); 
alert(myDate);

The alert shows me the value I entered in the DateInput control.

do you see any javascript errors (in IE)? What MWS version are you using?

best regards
Javier

Hi Javier,

Thanks for the reply.

If nothing is entered in the control, i am getting “undefined” in alert popup.

For this dateControl i defined yyyy/MM/dd as pattren.

If i enter any value other than the above format, i am getting “undefined”.
if i enter 2001/12/12, in popup “Wed Dec 12:00:00 UTC+0530 2001”.

My requirement is to check whether user has enterded the correct value or not.
null or not… pattren is correct or not.

there are no javascript errors…

Version Details:
MWS:7.1.2

Regards,
Sunil_N

Hi Sunil,

The returning of “undefined” value is a known issue with MWS 7.1.2, this will be fixed in the next fix release of MWS 7.1.2.

Regards

Vinay

Thank you Vinay.