You are not logged in.
#1 2007-10-05 18:05:27
- CDot
- Member
- Registered: 2007-09-03
- Posts: 4
'back' in gecko browser resets non-tinymce fields
Scenario: TinyMCE is used in a form alongside other conventional fields, and the content of all fields is modified. The user then navigates away by hitting submit. They then hit the 'back' button, and their edited content is correct in the TinyMCE fields but reset in all other form fields.
This problem is only reported on Gecko (Firefox and Epiphany tested). IE is known to work correctly. Safari not tested.
TinyMCE is inited by tinyMCE.init({mode : "exact", elements : "text"}) and attaches to a textarea which has id="text" and name="text". The second field is type="text" and has an initial value of "Some Text". When I view the page, I see TinyMCE. I modify the tinymce text, and the text in the second field, then hid submit. Then I hit "back" and voila - the edited text is still edited in TinyMCE, but has been reset to the default in the other textarea. When I comment out tinyMCE.init and repeat, then when I come "back" the text is still modified in both textareas.
I have attached a simple example to http://develop.twiki.org/~twiki4/cgi-bi … s/Item4737
Can anyone advise me (1) is this a known problem? and if so (2) is there a workaround? I searched the bug DB and the forum, but don't see anything similar reported.
Offline
#2 2007-10-05 19:42:58
Re: 'back' in gecko browser resets non-tinymce fields
I think this is the same problem that I managed to avoid in TinyMCE thats why it's working in that one. It seems to be a bug or problem in FF if you change the DOM of a form then the values are not restored correctly using the back button. This was something that worked in earlier firefox versions but not now. I haven't reported this to Bugzilla maybe you can do it if you feel up to it.
Best regards,
Spocke - Main developer of TinyMCE
Offline
#3 2007-10-05 20:22:47
- CDot
- Member
- Registered: 2007-09-03
- Posts: 4
Re: 'back' in gecko browser resets non-tinymce fields
But Spocke, it's *not* working in TinyMCE. Or did you mean "in IE?"
I looked in Mozilla Bugzilla, and there are many reports of the same or similar behaviour. https://bugzilla.mozilla.org/show_bug.cgi?id=285730 has this:
---
This is a known issue with form state restoration.... The problem is that we
save state at document teardown, and restore when the element is created. Part
of the key that identifies the form control is the position of the form control
in the form. In this case, that position is _different_ at the two points in
time (at teardown, it's at position 1, while at creation it's in position 0).
The position used to be identical because of bug 204784, since "position in
form" didn't get updated when the object was added.
I'm not sure there's anything sane to do here short of coming up with a better
way of identifying "the same form control".... or caching the DOM on
back/forward, of course. ![]()
---
Doesn't sound too promising :-(
Crawford Currie - Author of TinyMCE integration into TWiki
Offline
© 2003-2010