Web Analytics Made Easy -
StatCounter Passing Variables to Form Pages - CodingForum

Announcement

Collapse
No announcement yet.

Passing Variables to Form Pages

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

  • Passing Variables to Form Pages

    Does anybody know of a technique to pass variables to frame pages using javascript?

    I can use window.location.search to retrieve a variable from a normal page.

    I'm going for the effect of when a user clicks on a link, it opens a frame window with my navigation bar on the top and the new page on bottom.

    The problem is that I want to specify which page loads in the bottom in the link to the frame page.

    For example:

    <a href="/framesetpage.html?link=http://mysite.com">View this site</a>
    <a href="/framesetpage.html?link=http://yoursite.com">View your site</a>

    Then it loads a frame page with the nav page at the top, and whatever page was clicked on below...

  • #2
    yeah, i think i know what you want.

    you use links the way you've got them set up now, and your frameset page looks like this.

    <script>
    function lode() {
    var temp = "";
    if (window.location.search) {
    temp = window.location.search.slice(1);
    }

    self.frames['bottomFrame'].location = temp;
    }

    self.onload = lode;
    </script>
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

    Comment


    • #3
      What am I doing wrong on this?

      I'm calling the page "outside.html" and referencing it using <a href="outside.html?temp=http://www.mysite.com">Link is here</a>


      The source of "outside.html" looks like:

      <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
      <html>
      <head>
      <frameset ROWS="108,*" >
      <frame NAME="A" SRC="framenav.html" NORESIZE="yes" SCROLLING="no">
      <frame NAME="B" SRC="framemain.html">
      </frameset>
      </head>
      <body>

      <script>
      function lode() {
      var temp = "";
      if (window.location.search) {
      temp = window.location.search.slice(1);
      }

      self.frames['B'].location = temp;
      }

      self.onload = lode;
      </script>

      </body>
      </html>

      Comment


      • #4
        <a href="outside.html?temp=http://www.mysite.com">Link is here</a>

        get rid of the part in bold, and it should work.
        bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

        i am a loser geek, crazy with an evil streak,
        yes i do believe there is a violent thing inside of me.

        Comment


        • #5
          Hmmm...

          No errors show up but it never redirects to the new page. Just shows framemain.html in the lower frame.

          Comment


          • #6
            can i see a link to the page this is on?
            bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

            i am a loser geek, crazy with an evil streak,
            yes i do believe there is a violent thing inside of me.

            Comment


            • #7
              Hmm...

              I think Dave Clark has a script that does something like this... I remember seeing it in the old forum...
              redhead

              Comment


              • #8
                Okay...

                after copying the code directly it came up with an error:
                'window.top.frames.pageb has no properties.'

                I changed this line:
                <frame name="cartfmainwindow" scrolling="yes">

                to this:
                <frame name="cartfmainwindow" scrolling="yes" src="framemain.html">

                and it worked! No clue why but I'm glad it does!

                Thanks for the help,

                - J

                Comment

                Working...
                X