Form resets if floatbox resized

Page: 1

Author Post
kej
Guest
I am trying to use a form in an iframe floatbox, with a link that controls how much data is displayed on the form. What I want to happen is that when the user clicks on a link, a hidden div is shown ad the floatbox is resized to accommodate this additional info.

Everything works great, EXCEPT:
- when the box is resized, most popular browsers reset the form, so the user loses the info they had previously entered.

I've tested this with several browsers:
- IE 7 on windows resets the form
- Firefox 3.0.8 on Mac resets the form
- Safari 4 (beta) on Mac does NOT reset the form

Is there any way to overcome this behavior and have floatbox NOT reset the form?
Administrator
Registered: Aug 2008
Posts: 3382
I can see how this would be useful behaviour, but it's not how floatbox currently does it (as you know). It's now on the enhancement list.

I think there's a quick code page that give the behaviour your want. Sorry, I have no time to test it right now, but try this if you like and let me know how it goes. In floatbox.js, in the showContent function, find this (line 1709?):
if (this.currentItem.type === 'iframe') {
this.fbContent.src = this.currentItem.href;
} else if (/flash|quicktime/.test(this.currentItem.type)) {

Change the middle line to read:
if (this.fbContent.src.indexOf(this.currentItem.href) === -1) this.fbContent.src = this.currentItem.href;

It should work for you. Good luck... ;)
kej
Guest
This works!
The behavior is exactly what I wanted.
Is there any downside to this change? Anything I should avoid doing?

Thanks so much!!!
Administrator
Registered: Aug 2008
Posts: 3382
I think it is a safe change. It's one I'll be baking into future releases with slight modification. Thanks for being the guinea pig (and for raising the problem in the first place).
kej
Guest
Thanks Byron,
I am soooooooo happy with floatbox, and your support is the best!
/Krysia

Page: 1