redirection on the form button?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • xman

    #1

    redirection on the form button?

    how create redirection to some URL by clicking on the form button?

    any ideas?


  • kaeli

    #2
    Re: redirection on the form button?

    In article <d2k7p8$flb$1@s s405.t-com.hr>, nospam@xxx.com enlightened us
    with...[color=blue]
    > how create redirection to some URL by clicking on the form button?
    >
    > any ideas?[/color]

    Plenty.
    The simplest being
    onClick="top.lo cation.replace( 'myNewLocation. html');"
    (which will also break out of a frameset)

    There are more ways to do this (server-side, mostly) if you need to pass
    header or request info or want to keep history, replace only one frame, etc.

    --
    --
    ~kaeli~
    What do they use to ship styrofoam?



    Comment

    • xman

      #3
      Re: redirection on the form button?

      [color=blue]
      > Plenty.
      > The simplest being
      > onClick="top.lo cation.replace( 'myNewLocation. html');"
      > (which will also break out of a frameset)
      >[/color]
      RE: sorry I am javascript newbie

      where add it:

      <html>
      <head>
      <title>Untitl ed Document</title>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      </head>

      <body>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <form name="form1" method="post" action="">
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>
      <input type="submit" name="Submit" value="Submit">
      </p>
      </form>
      <p>&nbsp;</p>
      </body>
      </html>


      Comment

      • xman

        #4
        Re: redirection on the form button?

        and

        <input type="submit" name="Submit"
        onclick="top.lo cation.replace( 'myNewLocation. html');form1.su bmit();">


        but nothing..


        "xman" <nospam@xxx.com > wrote in message news:d2kgj3$gh$ 1@ss405.t-com.hr...[color=blue]
        >I am try next, but not work:
        >
        > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        > "http://www.w3.org/TR/html4/loose.dtd">
        > <html>
        > <head>
        > <title>Untitl ed Document</title>
        > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        > </head>
        >
        > <body>
        > <form name="form1" method="post" action="">
        > <p>&nbsp; </p>
        > <p>
        > <input type="submit" name="Submit"
        > onclick="top.lo cation.replace( 'myNewLocation. html');" value="Submit">
        > </p>
        > </form>
        > </body>
        > </html>
        >
        >[/color]


        Comment

        • xman

          #5
          Re: redirection on the form button?

          I am try next, but not work:

          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd">
          <html>
          <head>
          <title>Untitl ed Document</title>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
          </head>

          <body>
          <form name="form1" method="post" action="">
          <p>&nbsp; </p>
          <p>
          <input type="submit" name="Submit"
          onclick="top.lo cation.replace( 'myNewLocation. html');" value="Submit">
          </p>
          </form>
          </body>
          </html>


          Comment

          • xman

            #6
            Re: redirection on the form button?

            error is: HTTP405 Resource not allowed

            "xman" <nospam@xxx.com > wrote in message news:d2kgqe$r1$ 1@ss405.t-com.hr...[color=blue]
            > and
            >
            > <input type="submit" name="Submit"
            > onclick="top.lo cation.replace( 'myNewLocation. html');form1.su bmit();">
            >
            >
            > but nothing..
            >
            >
            > "xman" <nospam@xxx.com > wrote in message
            > news:d2kgj3$gh$ 1@ss405.t-com.hr...[color=green]
            >>I am try next, but not work:
            >>
            >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
            >> "http://www.w3.org/TR/html4/loose.dtd">
            >> <html>
            >> <head>
            >> <title>Untitl ed Document</title>
            >> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
            >> </head>
            >>
            >> <body>
            >> <form name="form1" method="post" action="">
            >> <p>&nbsp; </p>
            >> <p>
            >> <input type="submit" name="Submit"
            >> onclick="top.lo cation.replace( 'myNewLocation. html');" value="Submit">
            >> </p>
            >> </form>
            >> </body>
            >> </html>
            >>
            >>[/color]
            >
            >[/color]


            Comment

            • kaeli

              #7
              Re: redirection on the form button?

              In article <d2kgqe$r1$1@ss 405.t-com.hr>, nospam@xxx.com enlightened us
              with...[color=blue]
              > and
              >
              > <input type="submit" name="Submit"
              > onclick="top.lo cation.replace( 'myNewLocation. html');form1.su bmit();">
              >
              >
              > but nothing..
              >[/color]

              You can't do that. The replace of the location wipes out the form.

              What exactly are you trying to accomplish here? I think there's a better way
              for you than this.
              If you just want to redirect to a page when a user clicks a button, do it
              this way:

              <form>
              <input type="button" name="b1" value="click here"
              onClick="top.lo cation.replace( 'myPage.html'); ">
              </form>

              Note: change myPage.html to a REAL page/URL. That's just an example.

              --
              --
              ~kaeli~
              I can't sleep. The clowns might eat me.



              Comment

              • PHP2

                #8
                Re: redirection on the form button?

                [color=blue]
                >
                > What exactly are you trying to accomplish here? I think there's a better
                > way
                > for you than this.
                > If you just want to redirect to a page when a user clicks a button, do it
                > this way:
                >
                > <form>
                > <input type="button" name="b1" value="click here"
                > onClick="top.lo cation.replace( 'myPage.html'); ">
                > </form>
                >
                > Note: change myPage.html to a REAL page/URL. That's just an example.[/color]


                RE: yes it work, if I have not form action "/masterpanel/index.cgi"!

                but I must have it because YES button!
                <form name="form1" method="post" action="/masterpanel/index.cgi">

                how can NO button work at same time?


                Comment

                • PHP2

                  #9
                  Re: redirection on the form button?

                  no, all is ok!

                  thanks :-D


                  "PHP2" <nospam@nospam. tv> wrote in message
                  news:d2rm45$bsl $1@ss405.t-com.hr...[color=blue]
                  >[color=green]
                  >>
                  >> What exactly are you trying to accomplish here? I think there's a better
                  >> way
                  >> for you than this.
                  >> If you just want to redirect to a page when a user clicks a button, do it
                  >> this way:
                  >>
                  >> <form>
                  >> <input type="button" name="b1" value="click here"
                  >> onClick="top.lo cation.replace( 'myPage.html'); ">
                  >> </form>
                  >>
                  >> Note: change myPage.html to a REAL page/URL. That's just an example.[/color]
                  >
                  >
                  > RE: yes it work, if I have not form action "/masterpanel/index.cgi"!
                  >
                  > but I must have it because YES button!
                  > <form name="form1" method="post" action="/masterpanel/index.cgi">
                  >
                  > how can NO button work at same time?
                  >[/color]


                  Comment

                  Working...