Results 1 to 3 of 3
  1. #1
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    North Carolina
    Array of Html Forms on Same Page?
    Imagine a file with say 10 lines in it. Each line contains 5 pipe delimited fields. I would like to be able to load a web page that imports the file and displays each line and each line is separated into 5 separate input boxes.

    line 1 [][bbb][bbbbbb][bbbbbbbbbb][bbbbbbbbbbbbb][bbbbbbbbbbbbbbbbbbb]
    line 2 [][bbb][bbbbbb][bbbbbbbbbb][bbbbbbbbbbbbb][bbbbbbbbbbbbbbbbbbb]
    line 3 [][bbb][bbbbbb][bbbbbbbbbb][bbbbbbbbbbbbb][bbbbbbbbbbbbbbbbbbb]

    That's easy enough. I would also like to include a checkbox in front of each line. For each line that is checked, I would like to process each line of input elements. Not sure I can get my head around that. Make any sense?

  2. #2
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Sounds like you need to do some Javascript to loop through the checkboxes to determine if they're checked then process each associated field.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  3. #3
    Join Date
    November 13th, 2008
    You can use arrays as field names and then process each field array when you post the data. For instance:

    HTML Code:
    <input type="checkbox" name="line[1][checked]" value="true"> <input type="text" name="line[1][input_1]" value="bbbbb">
    <input type="checkbox" name="line[2][checked]" value="true"> <input type="text" name="line[2][input_1]" value="ccccc">
    Then on the page that processes the POST:

    PHP Code:
    foreach($_POST['line'] as $line) { 
       if (
    $line[checked] == true) { 
    // do something with $line['input_1']
    I think that's what you were asking, if not post again and explain further and I can help you out.

  4. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. HTML links for a specific page.
    By jpb1958 in forum ShareASale - SAS
    Replies: 4
    Last Post: August 11th, 2010, 06:02 PM
  2. cgi-email forms + success page
    By Cursal in forum Programming / Datafeeds / Tools
    Replies: 7
    Last Post: November 2nd, 2004, 08:24 AM
  3. HTML Forms
    By gregdi in forum Programming / Datafeeds / Tools
    Replies: 4
    Last Post: April 5th, 2004, 06:06 AM
  4. Page name in the html of the page question
    By Doug247 in forum WebMerge (
    Replies: 0
    Last Post: February 10th, 2004, 06:15 PM
  5. CGI - Sending email from HTML forms
    By c4 in forum Programming / Datafeeds / Tools
    Replies: 3
    Last Post: March 27th, 2002, 09:29 AM

Posting Permissions

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