For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > March 2004 > declare variable to pass to php









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author declare variable to pass to php
Bert

2004-03-27, 11:54 pm

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

2004-03-28, 10:13 pm

"Bert" <bert_remove@meckcom.net> wrote in message
news:SOq9c.1912$YT1.723@fe07.usenetserver.com...
> 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
>
>


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.


Geoff Berrow

2004-03-28, 10:13 pm

I noticed that Message-ID:
<Gwu9c.347193$Po1.136829@twister.tampabay.rr.com> from jn contained the
following:

>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.


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/
Chung Leong

2004-03-28, 10:13 pm


Uzytkownik "jn" < usenet*spamistehsuckremovetoreply*@jason
norris.net> napisal
w wiadomosci news:Gwu9c.347193$Po1.136829@twister.tampabay.rr.com...
> "Bert" <bert_remove@meckcom.net> wrote in message
> news:SOq9c.1912$YT1.723@fe07.usenetserver.com...
> 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.


Another way, stick the value into the cookie:

<html>
<head>
<script>

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

</script>
</head>
<body>
<input type="checkbox" id="umlaut" onclick="set_cookie_value(this.checked)">
<label for="umlaut">Check me</label>
</body>
</html>


jn

2004-03-28, 10:13 pm

"Chung Leong" <chernyshevsky@hotmail.com> wrote in message
news:ycOdnQl8bOlXYPvdRVn-jg@comcast.com...
>
> Uzytkownik "jn" < usenet*spamistehsuckremovetoreply*@jason
norris.net>

napisal
> w wiadomosci news:Gwu9c.347193$Po1.136829@twister.tampabay.rr.com...
> to
>
> Another way, stick the value into the cookie:
>
> <html>
> <head>
> <script>
>
> function set_cookie_value(checked) {
> document.cookie = 'umlaut=' + ((checked) ? 'uberkool!' : '');
> }
>
> </script>
> </head>
> <body>
> <input type="checkbox" id="umlaut"

onclick="set_cookie_value(this.checked)">
> <label for="umlaut">Check me</label>
> </body>
> </html>


That's a good idea.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com