declare variable to pass to php

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

    declare variable to pass to php

    I have a check box on page 1 of an html page with no submit button.
    There is a list of links that call a php display page from page 1.

    I want to check the status of the check box from the display page but I
    haven't found a way to pass the value without a submit function.

    I have hunted in the help and the on line turorials etc but have found
    nothing that helps.

    Any suggestions on how to do this or links that will help me do it
    appreciated.

    Bert



  • jn

    #2
    Re: declare variable to pass to php

    "Bert" <bert_remove@me ckcom.net> wrote in message
    news:SOq9c.1912 $YT1.723@fe07.u senetserver.com ...[color=blue]
    > I have a check box on page 1 of an html page with no submit button.
    > There is a list of links that call a php display page from page 1.
    >
    > I want to check the status of the check box from the display page but I
    > haven't found a way to pass the value without a submit function.
    >
    > I have hunted in the help and the on line turorials etc but have found
    > nothing that helps.
    >
    > Any suggestions on how to do this or links that will help me do it
    > appreciated.
    >
    > Bert
    >
    >[/color]

    One way:

    Use Javascript to check the value of the checkbox. Have your links point to
    a Javascript function that appends the value of the checkbox to the
    querystring of your link. Then forward the user to that URL.


    Comment

    • Geoff Berrow

      #3
      Re: declare variable to pass to php

      I noticed that Message-ID:
      <Gwu9c.347193$P o1.136829@twist er.tampabay.rr. com> from jn contained the
      following:
      [color=blue]
      >One way:
      >
      >Use Javascript to check the value of the checkbox. Have your links point to
      >a Javascript function that appends the value of the checkbox to the
      >querystring of your link. Then forward the user to that URL.[/color]

      Another way:
      Turn the links into image submit buttons
      --
      Geoff Berrow (put thecat out to email)
      It's only Usenet, no one dies.
      My opinions, not the committee's, mine.
      Simple RFDs http://www.ckdog.co.uk/rfdmaker/

      Comment

      • Chung Leong

        #4
        Re: declare variable to pass to php


        Uzytkownik "jn" <usenet*spamist ehsuckremovetor eply*@jasonnorr is.net> napisal
        w wiadomosci news:Gwu9c.3471 93$Po1.136829@t wister.tampabay .rr.com...[color=blue]
        > "Bert" <bert_remove@me ckcom.net> wrote in message
        > news:SOq9c.1912 $YT1.723@fe07.u senetserver.com ...
        > Use Javascript to check the value of the checkbox. Have your links point[/color]
        to[color=blue]
        > a Javascript function that appends the value of the checkbox to the
        > querystring of your link. Then forward the user to that URL.[/color]

        Another way, stick the value into the cookie:

        <html>
        <head>
        <script>

        function set_cookie_valu e(checked) {
        document.cookie = 'umlaut=' + ((checked) ? 'uberkool!' : '');
        }

        </script>
        </head>
        <body>
        <input type="checkbox" id="umlaut" onclick="set_co okie_value(this .checked)">
        <label for="umlaut">Ch eck me</label>
        </body>
        </html>


        Comment

        • jn

          #5
          Re: declare variable to pass to php

          "Chung Leong" <chernyshevsky@ hotmail.com> wrote in message
          news:ycOdnQl8bO lXYPvdRVn-jg@comcast.com. ..[color=blue]
          >
          > Uzytkownik "jn" <usenet*spamist ehsuckremovetor eply*@jasonnorr is.net>[/color]
          napisal[color=blue]
          > w wiadomosci news:Gwu9c.3471 93$Po1.136829@t wister.tampabay .rr.com...[color=green]
          > > "Bert" <bert_remove@me ckcom.net> wrote in message
          > > news:SOq9c.1912 $YT1.723@fe07.u senetserver.com ...
          > > Use Javascript to check the value of the checkbox. Have your links point[/color]
          > to[color=green]
          > > a Javascript function that appends the value of the checkbox to the
          > > querystring of your link. Then forward the user to that URL.[/color]
          >
          > Another way, stick the value into the cookie:
          >
          > <html>
          > <head>
          > <script>
          >
          > function set_cookie_valu e(checked) {
          > document.cookie = 'umlaut=' + ((checked) ? 'uberkool!' : '');
          > }
          >
          > </script>
          > </head>
          > <body>
          > <input type="checkbox" id="umlaut"[/color]
          onclick="set_co okie_value(this .checked)">[color=blue]
          > <label for="umlaut">Ch eck me</label>
          > </body>
          > </html>[/color]

          That's a good idea.


          Comment

          Working...