简体   繁体   中英

Play! 1.2.5 javascript datetimepicker not getting displayed

Folks,

I am trying to add a DateTimePicker javascript file in one of the screen. On clicking the calender icon, the calender is not getting poped up.

I added the javascript file in the public/javascript folder and the image in the public/images folder.

Then I added this line in main.html:

<script type="text/javascript" src="@{'/public/javascripts/datetimepicker_css.js'}" ></script>

and this line for diaplsying the image beside the textbox:

<input type="text" styleId="demo1" name="transaction.returnDate" size="10">
<img src="@{'/public/images/cal.gif'}" onclick="javascript:NewCssCal('demo1')" style="cursor:pointer"/> 

When the screen is loaded, the image is getting diaplsyed properly beside the textbox. But when I click it, the calendar is not getting displayed.

I use these two lines in my other struts application and it works fine:

<script language="javascript" type="text/javascript" src="/MediaTest/datetimepicker/datetimepicker_css.js">

<html:text styleId="demo1" name="returnForm" property="returnDate" size="10"></html:text>
<img src="/MediaTest/datetimepicker/cal.gif" onclick="javascript:NewCssCal('demo1')" style="cursor:pointer"/>

Please let me know how to make it work.

Thanks,

styleId属性更改为id

<input type="text" id="demo1" name="transaction.returnDate" size="10">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM