By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,302 Members | 1,812 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,302 IT Pros & Developers. It's quick & easy.

How to pass check box values

P: 4
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
Share this Question
Share on Google+
2 Replies


Atli
Expert 5K+
P: 5,058
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

P: 4
Thanks, my coding is like this,

Expand|Select|Wrap|Line Numbers
  1. href="secondpage.php" 
  2.  
  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.