Advanced Search

Results 1 to 2 of 2

Thread: Looking for help ,will pay.

  1. #1
    Join Date
    Sep 2008
    Posts
    13
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default Looking for help ,will pay.

    1) Describe Work Request (be as detailed as possible):

    2) Payment methods you support (ie:2checkout ):

    Hi There,

    How are you,

    I have a order form ,that has a option to add text boxes dynamically.
    So the user can add boxes as they like and enter their details in these text boxes.

    there are some fixed text boxes are present on this form.I have no problem getting values/data from these text boxes.I set it up to send details from this form to my email address.

    I'm wondering how can I get data from dynamically text boxes that are add by user.

    Thank You

    God Bless You.

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Are you referring on the same code from this thread?
    http://dynamicdrive.com/forums/showthread.php?t=37149

    If so, change your script from:
    Code:
    inp1.setAttribute("name","Product" + rownum);
    .
    .
    .
    inp2.setAttribute("name","Manufacture" + rownum);
    to:
    Code:
    inp1.setAttribute("name","Product[]");
    .
    .
    .
    inp2.setAttribute("name","Manufacture[]");
    ...and so, on your PHP, you could loop through all the Products and Manufacturer:
    PHP Code:
    echo $_POST['product'][0];
    echo 
    $_POST['product'][1]; 
    ...or a dynamic approach:
    PHP Code:
    <?php
    $product
    =sizeof($_POST['product']); // Returns the length of product field
    // $manufacturer=sizeof($_POST['manufacture']); // Returns the length of manufacture field
    for($i=0;$i<$product;$i++)
        echo 
    $_POST['product'][$i]; // Shows contents of each product field
    ?>
    Hope that helps.

    Let me know if you're still stumped, probably via PM, chat or email, or at any setting you are convenient.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. The Following User Says Thank You to rangana For This Useful Post:

    sheraz79 (10-22-2008)

Bookmarks

Posting Permissions

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