1

Well, as the title says, I would like to duplicate a certain field value into a field which is included by div, from another file.

I have it working without the included file. But when I cut out the second field with its form out and paste it into another file, which next off is included by <object> element, it won't paste it anymore.

http://jsfiddle.net/amstel/9tmPC/1/

Fyi, the code isn't working in jsfiddle, is does when published, I don't know the correct setting in jsfiddle.

And, the <object> element I use is simply:

<div style="margin: 0 auto; width:100%; height:200px;">
<object type="text/html" data="URL"
        style="width:100%; height:100%; margin:1%;">
</object>
</div>

Any ideas?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Tim
  • 45
  • 6

1 Answers1

0

Sorry that it isn't in pure JS but it's very easy in jQuery.

$( "#yes" ).click(function() {
  duplicate();
});

http://jsfiddle.net/9tmPC/8/

Update: Sorry I misread what you wanted. What you seem to need is to pass a variable between two pages. This can be done with:

  • Cookies
  • localStorage
  • GET Variables

Please see: how to exchange variables between two HTML pages?

Community
  • 1
  • 1
ZeroBased_IX
  • 2,667
  • 2
  • 25
  • 46