[RESOLVED] Dynamic form not posting correct data
Results 1 to 6 of 6

Thread: [RESOLVED] Dynamic form not posting correct data

  1. #1
    Asteroid
    Join Date
    Aug 2002
    Posts
    4

    resolved [RESOLVED] Dynamic form not posting correct data

    Hi,
    I am creating dynamic form and fields on the fly with values coming from a DB. My issue is that I am not able to post the listed field values to the next page.
    I know I have to use a for loop with an array identifying each field within the form.
    Would really appreciate if someone could guide me on this.
    <?
    $query = "SELECT * FROM registerData WHERE email_add = '$emailAdd'";
    $result = mysql_query($query);
    echo "<table border='1' width='700' style='position : absolute; top:330px; left : 50px;'>";
    echo "<tr><th>ID</th><th>School Name</th><th>Class/Division</th><th>Child's Name</th><th>Application Status</th><th>LaunchApp</th></tr>";

    While ($row = mysql_fetch_array($result))
    {
    echo "<Form name='LaunchApp' method='POST' action='test.php'>";
    echo "<tr><td>";
    $policyID1 = $row['policygen'];
    echo "<input type='text' name='policyID1' size='4' disabled='true' value ='$policyID1'>";
    echo "</td><td>";
    $schoolname1 = $row['school_name'];
    echo "<input type='text' name='schoolname1' size='4' disabled='true' value ='$schoolname1'>";
    echo "</td><td>";
    $classDiv1 = $row['class_div'];
    echo "<input type='text' name='classDiv1' size='4' disabled='true' value ='$classDiv1'>";
    echo "</td><td>";
    $childname1 = $row['child_name'];
    echo "<input type='text' name='childname1' size='4' disabled='true' value ='$childname1'>";
    echo "</td><td>";
    $emailAdd1 = $row['email_add'];
    echo "<input type='text' name='emailAdd1' size='10' disabled='true' value ='$emailAdd1'>";
    echo "</td><td>";
    echo "<input type='submit' name='startpolicy' value='Go'>";
    echo "</td></tr></form>";
    }
    echo "</table>";

    ?>

    test.php

    <?
    session_start();

    $emailAdd1 = $_POST['emailAdd1'];
    $policyID1 = $_POST['policyID1'];
    echo $emailAdd1;
    echo $policyID1;

    ?>

  2. #2
    Senior Member dagon's Avatar
    Join Date
    Nov 2001
    Posts
    6,178
    is the whole post array empty (print_r($_POST)) on test.php, or ?

  3. #3
    Asteroid
    Join Date
    Aug 2002
    Posts
    4
    test.php comes up with the following error...

    Notice: Undefined index: emailAdd1 in /opt/lampp/htdocs/firstinsurance/test.php on line 4
    Notice: Undefined index: policyID1 in /opt/lampp/htdocs/firstinsurance/test.php on line 5

  4. #4
    Asteroid
    Join Date
    Aug 2002
    Posts
    4
    Get the following error
    Array ( [startpolicy] => Go )

  5. #5
    Pedantic Curmudgeon Weedpacket's Avatar
    Join Date
    Aug 2002
    Location
    General Systems Vehicle "Thrilled To Be Here"
    Posts
    21,885
    All of your form fields are disabled. Disabled form fields aren't submitted.
    THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER
    FAQs! FAQs! FAQs! Most forums have them!
    Search - Debugging 101 - Collected Solutions - General Guidelines - Getting help at all

  6. #6
    Asteroid
    Join Date
    Aug 2002
    Posts
    4
    Thanks a lot weedpacket.... it worked...
    feel stupid at times like this....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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