AK <ama-l...@...> writes:
> On IRC, Aaron helped clean this up for me:
> 
> onclick="cal17.select(document.forms[0].elements["item.dateFound"],
>                                         ^^^^^^^^
> 'anchor17','MM/dd/yyyy');return false;" 
> 
> The other thing that was suggested is not using document.forms[0] since this 
> onclick would not work if another form was added to the top of this one.  As 
> such, I added an 'id' to my form:
> 
> <s:form beanclass="...action.AddItemFormActionBean" id="AddItemForm">
> 
> And then reference that within the onclick:
> 
> <s:text name="item.dateFound" id="item_dateFound" class="required" />
> 
> onclick="calPop.select(document.getElementById('AddItemForm').elements
> ['item.dateFound'],'anchor_item_dateFound','MMM dd, yyyy'); return false;" 

A futher follow-up:

Rather than having an ID on the form, I'm just putting an id into the s:text 
element:

<s:text name="item.date" id="item-date" class="required" />

And then just referencing the element via the id:

onclick="calPop.select(document.getElementById('item-date'),
'anchor_item_dateFound','MMM dd, yyyy'); return false;" 


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to