www.webdeveloper.com
Results 1 to 7 of 7

Thread: [RESOLVED] Textarea Response

  1. #1
    Join Date
    Jul 2006
    Posts
    207

    resolved [RESOLVED] Textarea Response

    OK, here's my code:

    Code:
    <form action=\"http://bigboardsresources.com/index.php?act=Msg&CODE=4&MID=1\" method='post'>
    <textarea rows='1' cols='7' name='Post' class='forminput' style='font-size:11px;overflow:hidden'></textarea><input type='hidden' name='MODE' value='01'><br>
    <textarea rows='1' cols='7' name='Post' class='forminput' style='font-size:11px;overflow:hidden'></textarea><input type='hidden' name='MODE' value='01'><br><input type='submit' class='prvw' value=''>
    </form>
    Using that code sends a private message to me (I left out some coding), and inserts in the private message textbox whatever the person inputs in the textarea. However, upon clicking the "submit" button, I only receive the input of the second textarea and not the first. How would I be able to receive the inputs in both textareas, and not just the second one?

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Change the name values:
    Code:
    <form action=\"http://bigboardsresources.com/index.php?act=Msg&CODE=4&MID=1\" method='post'>
    <textarea rows='1' cols='7' name='Post[]' class='forminput' style='font-size:11px;overflow:hidden'></textarea><input type='hidden' name='MODE' value='01'><br>
    <textarea rows='1' cols='7' name='Post[]' class='forminput' style='font-size:11px;overflow:hidden'></textarea><input type='hidden' name='MODE' value='01'><br><input type='submit' class='prvw' value=''>
    </form>
    Then server side pickup the value as an array:
    Code:
    $textarea1=$_POST['Post'][0];
    $textarea2=$_POST['Post'][1];
    The same would be required for the hidden inputs.
    Alternatively give them all different names.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Jul 2006
    Posts
    207
    Unfortunately, I won't be able to use either of those methods.

    The service I'm using doesn't allow PHP, and I can't edit the default source code, meaning "Post" is the only value I can respond to.

  4. #4
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    Give the second textarea a different name.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

  5. #5
    Join Date
    Jul 2006
    Posts
    207
    It doesn't work though, because the name "Post" is an ID that the textarea is sending the content to.

    I'm only able to edit the HTML posted above, not the HTML the textarea's are responding to.

  6. #6
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    At least 98% of internet users' DNA is identical to that of chimpanzees

  7. #7
    Join Date
    Jul 2006
    Posts
    207
    That won't really help in my situation, but you just gave me an idea for an alternative. Thanks, Fang!

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
  •  
HTML5 Development Center



Recent Articles