Web Analytics Made Easy -
StatCounter IFrame & Javascript - CodingForum

Announcement

Collapse
No announcement yet.

IFrame & Javascript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • IFrame & Javascript

    Hi all,

    I am sure this is a relatively straight forward issue to resolve but I can't for the life of me work out how to do it, so I would be grateful for anyones help.

    Basically, I have a page with an IFrame at the top but what I want to do is have a series of Javascript button commands so a user can specify something (like a website) and press the go button and it will load it in the IFrame but I want each command button to be different and do different things but want them to load in the same IFrame (hopefully that makes sense).

    So for example:

    Assume there is the following Javascript commands:

    <form onsubmit="doBES1(this.BES1.value); return false;">
    <input name="BES1" size="24" placeholder="Word or Phrase" type="text">
    <input value="Search" type="submit"></form></li></ul>

    <script type="text/javascript">
    function doSE1(SE1) {
    window.open('https://www.test.co.uk/#q=%22' + SE1 + '%22', 'domainwindow');
    }

    <form onsubmit="doBES2(this.BES2.value); return false;">
    <input name="BES2" size="24" placeholder="Word or Phrase" type="text">
    <input value="Search" type="submit"></form></li></ul>

    <script type="text/javascript">
    function doSE2(SE2) {
    window.open('https://www.test.co.uk/#q=%22' + SE2 + '%22', 'domainwindow');
    }

    I want user to be able to use either but have the results (no matter which they use) load in the Iframe and not on a new page - which these currently do.

    Thanks for your help.
Working...
X