You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Johan Compagner <jc...@j-com.nl> on 2001/05/11 16:07:48 UTC
Constants.TOKEN_KEY value proposed change (doesn't work with javascript!!)
Hi,
I use the token_key for transaction support.
But the value of the TOKEN_KEY = org.apache.struts.taglib.html.TOKEN
This is a very odd value to have as a hidden input field on your form.
Which is generated by the FormTag:
<input type="hidden" name="org.apache.struts.taglib.html.TOKEN"
value="xxxx">
Because you want to use that hidden field in some javascript:
function submitNextpage(themakey)
{
document.nextpage.org.apache.struts.taglib.html.TOKEN.value=themakey;
document.nextpage.submit();
}
You get a javascript error!
Because javascript sees all names between points as an object.
Please change the TOKEN_KEY value in "TOKEN_KEY" or something like that!!
Johan Compagner
Re: Constants.TOKEN_KEY value proposed change (doesn't work with javascript!!)
Posted by Johan Compagner <jc...@j-com.nl>.
It would be nicer to have a name for this that is a bit better suited for javascript!
johan
----- Original Message -----
From: "David Winterfeldt" <dw...@yahoo.com>
To: <st...@jakarta.apache.org>
Sent: Friday, May 11, 2001 5:56 PM
Subject: Re: Constants.TOKEN_KEY value proposed change (doesn't work with javascript!!)
> You can do this.
>
> document.nextpage["org.apache.struts.taglib.html.TOKEN"].value=themakey;
>
> David
>
> --- Johan Compagner <jc...@j-com.nl> wrote:
> > Hi,
> >
> > I use the token_key for transaction support.
> > But the value of the TOKEN_KEY =
> > org.apache.struts.taglib.html.TOKEN
> >
> > This is a very odd value to have as a hidden input
> > field on your form.
> > Which is generated by the FormTag:
> > <input type="hidden"
> > name="org.apache.struts.taglib.html.TOKEN"
> > value="xxxx">
> >
> > Because you want to use that hidden field in some
> > javascript:
> > function submitNextpage(themakey)
> > {
> >
> >
> document.nextpage.org.apache.struts.taglib.html.TOKEN.value=themakey;
> > document.nextpage.submit();
> > }
> >
> > You get a javascript error!
> > Because javascript sees all names between points as
> > an object.
> >
> > Please change the TOKEN_KEY value in "TOKEN_KEY" or
> > something like that!!
> >
> > Johan Compagner
> >
> >
> >
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
Re: Constants.TOKEN_KEY value proposed change (doesn't work with javascript!!)
Posted by David Winterfeldt <dw...@yahoo.com>.
You can do this.
document.nextpage["org.apache.struts.taglib.html.TOKEN"].value=themakey;
David
--- Johan Compagner <jc...@j-com.nl> wrote:
> Hi,
>
> I use the token_key for transaction support.
> But the value of the TOKEN_KEY =
> org.apache.struts.taglib.html.TOKEN
>
> This is a very odd value to have as a hidden input
> field on your form.
> Which is generated by the FormTag:
> <input type="hidden"
> name="org.apache.struts.taglib.html.TOKEN"
> value="xxxx">
>
> Because you want to use that hidden field in some
> javascript:
> function submitNextpage(themakey)
> {
>
>
document.nextpage.org.apache.struts.taglib.html.TOKEN.value=themakey;
> document.nextpage.submit();
> }
>
> You get a javascript error!
> Because javascript sees all names between points as
> an object.
>
> Please change the TOKEN_KEY value in "TOKEN_KEY" or
> something like that!!
>
> Johan Compagner
>
>
>
>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/