467,894 Members | 1,751 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,894 developers. It's quick & easy.

How to pass check box values

I have few check boxes in first page. this page has form action pointing to one page and href to other page.

How can I send check box values to page pointed by href?

I am using html/php.

Thank you.
May 27 '10 #1
  • viewed: 1677
2 Replies
Expert 4TB
The form is always submitted to the URL defined in the action attribute. A form element has no href attribute, so it shouldn't be there in the first place.

If you want to submit the form to both URLs, you will need to either:
  1. Post the form to the first URL and pass along the URL of the second page. Then have the PHP code the first URL executes forward the request to the second URL.
  2. Use AJAX to submit the form to one URL, and when that is done either use AJAX again on the other URL or just let the form submit it the old fashion way.

Either way, you can not submit the same form to two URLs using a single request. You will need some server or client side script to do one of them.
May 27 '10 #2
Thanks, my coding is like this,

Expand|Select|Wrap|Line Numbers
  1. href="secondpage.php" 
  3. <form method=post action='firstpage.php'>
  4. (check boxes)
  5. <input type="submit" value="Submit" />
  6. </form>
I shoud have two input ( submit and href). Your 1st option doesn't give as I understand it.
Second option is bit far from my knowledge. but will give a try later.

I thought about use frames , one frame has check boxes, when submit it register session variables. then submit or href could be used independantly.

But frames are condemn everywhere.

Appriciate your help very much.
May 27 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Russell | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.