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 to the CF scene
    Join Date
    May 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help passing drop down values to another form

    I'm trying to pass a drop down value on a form on one page to a form on the next page and haven't figured it out just yet. I know I'm missing something, just not sure what.

    Here's the simple dropdown:

    Code:
    input type="hidden" name="product[]" value="necklace1">
    <select name="product[]">
    <option value="black cord">black 18 inch rubber cord</option>
    <option value="silver chain">18 inch sterling silver box chain</option>
    <option value="blue cord-18">blue 18 inch rubber cord</option></select>
    On the next page, here's the variable:

    Code:
    $cord =  ($_POST['product[]']);
    Further down on the page, here's the select data element:

    Code:
    <input type="hidden" name="product[]" value="<?php echo $cord; ?>">
    I know I'm doing something wrong, after some hefty google trolling, just can't figure out exactly what, but I know I'm not passing the selected value to the next page. Any ideas?

  • #2
    New to the CF scene
    Join Date
    Jul 2007
    Location
    India
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    use this

    $cord = ($_POST['product']);

  • #3
    New to the CF scene
    Join Date
    May 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The drop-down value is fighting with the actual product value and overwrites the product name. There is actually a hidden field for the product name:

    Code:
    <INPUT TYPE="HIDDEN" NAME="product" VALUE="<?php echo $product; ?>">
    How do I get it to interact with this line:
    Code:
    <input type="hidden" name="product[]" value="<?php echo $cord[1]; ?>">
    Actually on the processed Shopping Cart site the information appears this way:

    product,dropdown value

    I've tried a few things and gotten the word "Array" to appear not exactly what I'm after either. Or with some tweaking I get "ArrayArray" Do I need to repeat the select form value?


  •  

    Posting Permissions

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