• I’m trying to implement a form from an old static website and use it in WordPress.

    If I use a static page in form action, and put a static order.php file in my site root, I can pass the form data to order.php

    <form action="https://www.example.com/order.php" id="signup" method="post" name="signup">

    If I instead use a dynamic page in the form action, let’s call it /dynamic_order_page, none of the data from the form will cary over:

    <form action="https://www.example.com/dynamic_order_page" id="signup" method="post" name="signup">

    I hope that you can help me spot what needs to be changed in order for the form data to be passed on a dynamic WordPress page.

    This is the form in its entirety:

    <form action="https://www.example.com/order.php" id="signup" method="post" name="signup">
    <div id="calculator" style="">
    <table align="center" border="0" class="vedit signup" summary="signup Form" width="600">
    
    <tr>
    <td>
    <table border="0" summary="">
    <tr>
    <td>
    <label><input checked id="cb1" name="ht1" onclick="CB(this);" type="checkbox" value="ht1">PLan a</label>
    </td>
    <td>
    <label><input id="cb2" name="ht2" onclick="CB(this);" type="checkbox" value="ht2">Plan b</label>
    </td>
    <td>
    <label><input id="cb3" name="ht3" onclick="CB(this);" type="checkbox" value="ht3">Plan c</label>
    </td>
    </tr>
    
    <tr>
    <td>
    <label><input id="cb4" name="ht4" onclick="CB(this);" type="checkbox" value="ht4">Plan d</label>
    </td>
    <td>
    <label><input id="cb5" name="ht5" onclick="CB(this);" type="checkbox" value="ht5">Plan e</label>
    </td>
    <td>
    <label><input id="cb6" name="ht6" onclick="CB(this);" type="checkbox" value="ht6">Plan f</label>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    
    <tr>
    <td><input class="required" id="SmaaGlas" name="small" onkeyup="Recalc();"
    size="5" style="color:Black;" type="text" value="0"> &nbsp;&nbsp; Small</td>
    </tr>
    
    <tr>
    <td><input class="required" id="AlmGlas" name="regular" onkeyup="Recalc();"
    size="5" style="color:Black;" type="text" value="0"> &nbsp;&nbsp; Normal</td>
    </tr>
    
    <tr>
    <td><input class="required" id="StoreGlas" name="big" onkeyup="Recalc();" size=
    "5" style="color:Black;" type="text" value="0"> &nbsp;&nbsp; Big</td>
    </tr>
    
    <tr>
    <td><input id="tot" name="tot" type="hidden" value=""><label><input id="Stige"
    name="Ladder" onclick="Recalc();" type="checkbox" value="ladder">Extra 1</label><br>
    </td>
    </tr>
    
    <tr>
    <td><label><input id="Indv" name="Indv" onclick="Recalc();" type="checkbox"
    value="Indv">Indvendig pudsning</label><br>
    </td>
    </tr>
    
    <tr>
    <td>
    <hr>
    </td>
    </tr>
    
    <tr>
    <td>
    <label><input checked id="r5" name="subscription" onclick="CB1(this);" type="checkbox" value="00">Option 1</label>
    <label><input id="r6" name="subscription" onclick="CB1(this);" type="checkbox" value="01">Option 2</label>
    <label><input id="r7" name="subscription" onclick="CB1(this);" type="checkbox" value="02">Option 3</label>
    <label><input id="r8" name="subscription" onclick="CB1(this);" type="checkbox" value="03">Option 4</label>
    
    </td>
    </tr>
    
    <tr>
    <td><input id="RabatCode" name="RabatCode" onkeyup="Recalc();" size="10" style="color:Black; display:none;" type="text" value=""></td>
    </tr>
    
    <tr>
    <th class="headrow">
    <div id="qwe">
    <div style="float:left;">
    <h1>
    <div style="font-size:26px;">Your number:&nbsp;<span id="total" style="color:green;"></span></div>
    </h1>
    </div>
    
    <div style="float: right; font-size: 22px; font-weight: bold; margin-top: 5px">
    <input class="butto" style="font-size: 16px; font-weight: bolder" title="Click here" type="submit" value="&nbsp;&nbsp;&nbsp;Order!&nbsp;&nbsp;&nbsp;">
    </div>
    
    </div>
    </th>
    </tr>
    </table>
    </div>
    </form>
Viewing 1 replies (of 1 total)
  • Thread Starter niemion

    (@niemion)

    So to summarize the issue:

    I have uploaded a static file to my WordPress root directory, because for some reason the form data is not passed on if I link to a dynamic WordPress page or post in the form action:

    <form action="https://www.example.com/order.php" id="signup" method="post" name="signup">

    This works, but I really don’t want to rely on such a messy solution. How can I have the form data passed on to a dynamic WordPress post or page? Have I used some reserved variable names or something, that breaks the form when I try to pass on the form data to a WordPress page?

Viewing 1 replies (of 1 total)
  • The topic ‘Passing form data to a WordPress page on method="post"’ is closed to new replies.