Re: Submitting form from <a href
| From: | Micah Stevens | Date: | Fri, 14 Jul 2006 23:08:07 +0000 |
| Subject: | Re: Submitting form from <a href | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-42202@lists.php.net to get a copy of this message | ||
A little javascript would do it.. like so:
<a href="Javascript: getElementById('letterpressed').value = 'A'; getElementById('thisform').submit; void 0;">A</a>
<!-- Repeat for each letter -->
<form action="target.php" id="thisform">
<input type="hidden" id="letterpressed" name="letterpressed" value="">
<input type="checkbox" name="campuses"> Check for all campuses
</form>
Then you have a $_POST that contains both.
-Micah
Skip Evans 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: <form...> A B C D E F G H I J K..... [] check for all campuses </form> 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.