Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    smple submit question

    Hi,

    I have a form.

    echo "<form action=creditcardbackend.php name=creditcard method=POST>"

    Based on Javascript function if statement
    I want to send it to differnt page then "creditcardbackend.php ".... how do I do that...


    if (document.creditcard .checkbox_all.checked){
    document.submit()??????
    }

    Thanks

  • #2
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    if (document.creditcard .checkbox_all.checked){
        document.forms[0].action = 'file.php';
        document.forms[0].submit();
    }
    but.. seeing as how I _think_ changing the action might not be allowed(security reason?).. you could always do it server side anyway.

    anyway.. serverside way:
    Code:
    if ($_POST['checkbox_all']) {
        include 'otherfile.php';
    } else {
    ///
    }

  • #3
    New Coder
    Join Date
    May 2004
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks a lot


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •