HTML only posts last text box for text form

user3362505

Here is my HTML code:

    <form name="candidates" action="candidate_thankyou.php" method="post">
    <div class="wrap"> 
        <div class="position"> President: <br> </div>
            <input type="text" name="president"> <br>
            <input type="text" name="president"> <br>
            <input type="text" name="president"> <br>
    </div>
    <div class="wrap"> 
        <div class="position"> Vice President: <br> </div>
            <input type="text" name="vp"> <br>
            <input type="text" name="vp"> <br>
            <input type="text" name="vp"> <br>
    </div> ...etc
    <input id="submit" type="submit" value="Submit">
    </form>

However, when I call var_dump($_POST) in my php file, I only get the last text box value for each input name (eg "president" or "vp"). If I only use the first 2 text boxes, I get an empty string. How can I get all three values from the form?

Mike

Field name must be either unique (president1, president2, etc.) or an array president[].

Further handling depends on which method you choose. Second method is well described in HTML form input tag name element array with JavaScript

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

HTML creating a text box for a form

From Dev

Value will blink only once at the html text box

From Dev

Value will blink only once at the html text box

From Dev

Activate html text form box when additional text form box text is deleted

From Dev

Text associated with a read only text box not shown in the HTML

From Dev

How to edit HTML Form text box using Javascript?

From Dev

How to edit HTML Form text box using Javascript?

From Dev

windows form text box text alignment

From Dev

Submit Contact Form Default Text In Text Box

From Dev

HTML text form value

From Dev

Submitting HTML text form?

From Dev

html input displays different text to value that it posts

From Dev

Dropdown box to change text in HTML

From Dev

Delete the last line of rich Text Box?

From Dev

Only spellcheck HTML text

From Dev

Make text box only highlight text on first click only

From Dev

How to move text from one web form text box to another web form text box

From Dev

Python: Selenium write in the text box of a form

From Dev

Dynamic text box content on an Access continuous form

From Dev

move textarea box next to text title in form

From Dev

Bootstrap form - label on right side of text box

From Dev

JavaScript VAR from form text box

From Dev

Text box alignment and corner style in form

From Dev

Access: Mark entries based on text box on form

From Dev

Capturing Text Box Value From Windows Form

From Dev

ng pattern for allowing only '-' in input text box

From Dev

Allow only numbers into a input text box

From Dev

text box only displaying one word as value

From Dev

Allow only numbers in range to be entered into text box

Related Related

HotTag

Archive