Results 1 to 7 of 7

Thread: A little help please

  1. #1
    Join Date
    Nov 2008
    Location
    Bulgaria
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default A little help please

    Hi all.
    I'm having some trouble with a certain project. Basically the site offers automatic inquiries about our services. When the form is filled out it is then sent to a certain e-mail. Dynamically added form elements are used in all the forms. In most of the forms a div is created and then the elements. Each element is named with an increasing name value(e.g. element1,element2 etc) so i can access them with a php loop later. In one of the forms it is required to create a div and optionally another one inside it. So when i post i can't get values from elements in the inner div, although i've traced them and the naming is correct. I'd be thankful for any advice on the subject!!

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You will need to post code, a link to your page, or something else in order for us to be of any help to you.
    The form may not be sending properly, the elements may not be named properly, or the php loop to find them may not be working properly.

    Remember, the other option is to name the second div of elements something different than the main div (like "elements2_1", etc.)
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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

    BullD0G (11-25-2008)

  4. #3
    Join Date
    Nov 2008
    Location
    Bulgaria
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Source

    Thanks for the quick reply. Sorry about the lack of code of anykind. My mistake.
    Here is the code for the forms.
    Sorry for the formatting and clearance of code. I know it's messed up but that's my type of faulty writing. Thanks again for the help!

  5. #4
    Join Date
    Nov 2008
    Location
    Bulgaria
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default More useful example

    Hi guys.
    I posted the attachment with the previous post because the site wasn't uploaded anywhere. Now i can give more useful links:
    The page that is working: http://www.flyingcargo-bg.com/test/enqair.html

    And the one that isn't working: http://www.flyingcargo-bg.com/test/enqsea.html

    Regards.

  6. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    If you give your elements names ending with [], then you can access them as an array within PHP. For example, if you have a set of inputs called foo[], and send them using POST, then in your PHP script they will be accessible as an array $_POST['foo'].
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #6
    Join Date
    Nov 2008
    Location
    Bulgaria
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re:

    Thanks for the advice. Will try this first thing tomorrow morning. Hope it works out. Funny thing is that i continued to trace elements after post today and they seem visible, but no such thing in php. Hope this works! Thanks!

  8. #7
    Join Date
    Nov 2008
    Location
    Bulgaria
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Unhappy Not working

    I tried the above method, but it doesn't work either. It still does not want to access variables and objects in the innermost div. The dynamically created div is only removed when it contains the objects created by its own script. When the other script for the inner lying div creates some elements the outer cannot be removed and the inner elements cannot be accessed!

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
  •