Forums

window.name not supported?

TonyGib 10 Feb, 2012
Hi Bob - can you make sense of this: I have created a variable in window.name in order to carry values between (Joomla) javascript in pages - this works (see pic 1). BUT, if I attempt to use window.name inside of a form (in JS) it doesn't work. Pics 2 and 3 show the code and the alert result.
Any ideas?๐Ÿ˜ข
GreyHead 10 Feb, 2012
Hi TonyGib,

It looks as though there isnโ€™t a Window name set by default. Not something I know anything about though :-(

If I set a window name then the alert displays correctly.

What are you actually trying to do here? Can you not pass the data in the URL or using Post?

Bob
TonyGib 10 Feb, 2012
Imagine a form ('A') with lots of check-box groups, describing options available to a user. Prior to this form being shown the user answers various question/answer steps - choosing the options they want. For each of these I put a value into window.name (imagine it as js session data) then, eventually we go to form 'A' and want to display only the groups they have selected using ...style.display = "none".

All works well, storing the data in window.name but, try to access it in form 'A', I get nothing. So, I am stuck ๐Ÿ˜ถ

This article gave me the idea: http://www.sitepoint.com/cookieless-javascript-session-variables/
GreyHead 10 Feb, 2012
Hi TonyGib,

Looking at the document you linked to it's only available in the window where it was created.

Why not just save it in the User session? Or in a cookie if the session isn't available.

Bob
TonyGib 10 Feb, 2012
Thanks for coming back Bob .. back to the drawing board! :?
This topic is locked and no more replies can be posted.