I have a feeling this is easy but, I’ve been working on it for some hours with little success.
I’m using iframe version of LightFace modal windows:
http://davidwalsh.name/facebook-lightbox
I’m trying to find a good way to make a form submit when they press a submit button that I add to the panel. The best I found so far is:
light = new LightFace.IFrame({ height:440, width:550, url: 'http://samplePage.html',
title: 'Sample' }).addButton('Submit', function() {
window.frames[window.frames.length-1].formName.submit();},'blue')
.addButton('Close', function() {light.close(); },true).open();
I’m not very confident with this code but I think for the submit it gets to the iframe I’m looking for by just assuming it’s the second to last one. This works on a webpage. Unfortunately I’m building this for a facebook app that loads within a Facebook iframe itself. When loading in the facebook page the code doesn’t do anything.
Does anyone have a better way of putting a submit button onto this?
There shouldn’t be much trouble with putting an iframe inside an iframe, however:
…could very well cause trouble. You are kind of tracking down your form, while I would try to target the form element directly, i.e. assign it an id:
and use the dollar sign to get to it: