How to pass check box values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrimalka
    New Member
    • May 2010
    • 4

    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.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

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

    Comment

    • mrimalka
      New Member
      • May 2010
      • 4

      #3
      Thanks, my coding is like this,

      Code:
      href="secondpage.php" 
      
      <form method=post action='firstpage.php'>
      (check boxes)
      <input type="submit" value="Submit" />
      </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.
      Last edited by Atli; May 27 '10, 07:16 AM. Reason: Added [code] tags.

      Comment

      Working...