0

I am working on a small project where I have a main html page; I have then made a separate settings.html file as well. I have the settings page popping up on click and displaying using:

jQuery('#settings').colorbox({iframe:true, width: "800px", height: "850px", onCleanup: function () { saveoptions(); } });

As you can see I have a custom function for on cleanup to save the settings. I don't want to have a save settings button on the settings page, just to have the user click out and then it prompts if you want to save. Problem is, I cant seem to access the iframe's elements when its closing down so I can save them.

How do you get access to the iframe's contents so that I can save them?

EDIT: If it helps, I am needing to access dropdown boxes and textbox values

Nick
  • 31
  • 4

1 Answers1

0

You should use the contents() method:

suppose you have iframe content: <div id="myContent"></div>

then use something like this:

$("#myiframe").contents().find("#myContent")

Also, the second option here may help you.

Krupal Shah
  • 8,949
  • 11
  • 57
  • 93