Just so you know, there is a general PHP user's list available for
just such a request.  It's rather high-traffic, so be warned.

Now then, on to the problem.  I believe I've figured out a way to make
this happen.  I've only tested it on IE 6 and Firefox, so your
browser compatibility may vary.  I'll just post the scripts I used to
test it here and you can take what you need and run with it.

Here is the script that my form is built in:


                <script language="Javascript">
                        function submitForm (letter)
                       = letter;    // 
Here's where we're
setting the form value 'letter' to the letter the user clicked on.
                      ;   // Then, submit the 
                <form name="search" method="POST" 
                        <input type="hidden" name="letter" value="">  <!-- If 
this isn't
here, the Javascript letter.value code won't work, since form.letter
doesn't exist.  -->
                        <input type="checkbox" name="checky"/> Search all 
                                for ($i = 65;  $i <= 90;  $i++)
                                        $letter = chr($i);
                                        print "<a 
href=\"javascript:submitForm('$letter')\">$letter</a> ";


The receiving end of the form looks much as you might expect, it just
parses the form values:


if (isset($_POST["checky"]))
        print "Checkbox value is: True<br>\n";
        print "Checkbox value is: False<br>\n";

print "Letter: " . $_POST["letter"];


And there you go!  Let me know if you have any problems.

On 7/14/06, Skip Evans <[EMAIL PROTECTED]> wrote:
Hey all,

This is not database related, but I get the
impression this list entertains general PHP
questions? If I'm mistaken, flame away.

I need submit a form when a hyper link is pressed,
and have been trying all manner of onlicks, etc,
but have been unable to hit the right combination.

Here's the scenario:

I have the alphabet in hyper links with a check
box below:

A B C D E F G H I J K.....

[] check for all campuses

What needs to happen is that when they click a
letter, which is a <a href=...> now, it submits
the check box value as well, to be read through
$_POST on the receiving end.

And of course I need to know what letter was
click, this I was trying to get through a
$_REQUEST var, but was not able to do so.

Any tips would be monstrously appreciated.
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701

PHP Database Mailing List (
To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to