You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ionel Gardais <io...@geomath.fr> on 2003/05/07 10:56:41 UTC

using a popup window to populate a form field fails

Hi,

I am using an ActionForm and the corresponding html form have text 
fields to populate it.

on of the text field is to specify a date. I use the calendar taglib to 
ease the date selection.
Calendar taglib allows to popup a window and to pick a date which executes :

javascript:opener.document.theform.thefield.value="2003/05/07";window.close();

in the calling jsp, I am using an ActionForm which includes objects that 
have fields inside.
so the code looks like :

      <tr>
        <td align=left valign=center colspan=2><bean:message 
key="prompt.meeting.start"/></td>
        <td align=left valign=center colspan=2><html:text 
property="date.start"/></td><BR>
      </tr>
      <tr>
        <td align=left valign=top colspan=2><bean:message 
key="prompt.meeting.end"/></td>
        <td align=left colspan=2><html:text property="date.end"/></td><BR>
      </tr>


the problem is that I can't remotly set these fields because the 
javascript is now

javascript:opener.document.theform.date.start.value="2003/05/07";window.close();

and nothing happens.

I think this is because of the "date.start" stuff which confuse the 
javascript.
but I need this property to set the ActionForm fields correctly.


does anybody have an hint ?

thanks,
ionel

-- 
- fetchez la vache
- quoi ?
- fetchez la vache !
- moooooooo



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: using a popup window to populate a form field fails

Posted by Sergey Smirnov <si...@exadel.com>.
> the problem is that I can't remotly set these fields because the
> javascript is now
>
>
javascript:opener.document.theform.date.start.value="2003/05/07";window.clos
e();
>
> and nothing happens.
>

Try to replace this call with the following one:
javascript:opener.document.theform["date.start"].value="2003/05/07";window.c
lose();

It should work.

Regards,
Sergey Smirnov
http://www.exadel.com/strutsStudio


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org