views:

40

answers:

1

The web app i'm creating uses jquery lights out and has an html iframe to an internal form. Whoever uses this app will have to press the submit button. Is there a way i can link a free area of space surrounding the submit button, so any clicks within that space call the jquery functions in my code?

I'd like to do this so submitting the form automatically closes the lights out messagebox, rather than app users seeing what happens in the iframe after they submit the form.

Thanks! -Diego

A: 

My suggestion is to put an iframe of a page from your own site on the iframed form page. Via url parameters you can submit data to the parent window because this second iframe is on the same domain.

Here is a really bad diagram of how the concept works.

```````````````````````````
|  parent window     <-data <<<<
|                                ^
| |====x-domain security====|    ^
| |  Your form page iframe  |    ^
| |  [submit]               |    ^
| |                         |    ^
| |  |````````````````````  |    ^
| |  |helper iframe  data->>>>>>  

Of course this means you would need access to the html of the external site.

See the top answer on this question for details. http://stackoverflow.com/questions/153152/resizing-an-iframe-based-on-content

It sounds like the same problem except you are manipulating jquery lights out instead of the height.

Keyo