onclick=fb.start() issues Chrome/Safari

Page: 1

Author Post
Member
Registered: Jun 2012
Posts: 3
Hello, this is my first time posting on the forums.

I am having an issue with fb.start() not loading onclick in Safari/Chrome but the code works fine in IE/Firefox. I have read other post that have stated that it is an issue with the webkit and to solve the issue use the onclick in a span. I am using an option tag, so I cannot use a span to call the onclick event. Here is a sample of the code.

<option onclick="fb.start('/product_img/example.html', 'controlsPos:tr height:300px width:800px autoFitHTML:true');" value="">Suggested Moving Supplies - Just getting started</option>

An example of the issue is at http://www.interplas.com/packaging-moving-supplies

Any insight to this issue would be much appreciated and thank you in advance for your input.
Administrator
Registered: Aug 2008
Posts: 3382
This is not a Floatbox question. This is about how different browsers have implemented click events for form elements. You may want to clarify what is being tested by swapping out the fb.start call for a simple alert. Something like onclick="alert('clicked')", leaving Floatbox completely out of the picture for now.

It seems to be a fact of life that different browsers have different patterns for triggering click events on form elements. It's all part of the fun of creating cross-browser compatible pages.

I would guess that the reference to the span was a suggestion to wrap the entire select element in a span and assign the onclick handler to that, and not a suggestion to wrap each option element in a span.

Also, if you want to start a Floatbox from a click on an option element, I suspect that you could use an onchange event tied to the select element instead. I believe the onchange event is more consistent across different browsers.

Hope this helps...
Member
Registered: Jun 2012
Posts: 3
Thank you for your reply.

I am sorry about the question not being floatbox related, I did test the alert and it failed in chrome and safari also. I tried your suggestion with the onchange, but it didn't work either. I will continue to research this problem and keep in mind what you have said about the different events.

Thanks a lot for your input. Hopefully it will lead to a solution for my problem!
Member
Registered: Jun 2012
Posts: 3
Solved the issue by using the onchange event handler as you suggested and adding a switch statement to check index value. Thanks again for you help and advise!

Page: 1