SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Oct 2008
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Submit button doesn't recognize inline added html

    I have a form, with a submit button. Inside this form i have one input text field, in addition to an add more button to add more of that input field using JQuery .html(val);. Now the issue appears when I submit the form, all inline added input fields are not recognized, they are not set and there is no data for them in the POST.

    Any idea how to sort that out?

    Thank you

  2. #2
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How are you adding the new input fields? Are you giving them all unique names?
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  3. #3
    SitePoint Addict
    Join Date
    Oct 2008
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How are you adding the new input fields? Are you giving them all unique names?
    Ah sorry.. yes of course.. unique incremented name and id attribute

    Code:
    <input name='input_1' id='input_1' type='text' />
    Then once I click on the add more, the code becomes as such

    Code:
    <input name='input_1' id='input_1' type='text' />
    <input name='input_2' id='input_2' type='text' />
    The second line is added through JQuery .append(), sorry i mentioned .html(val) above, but that was an old code...

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure they get added inside the form, and not below/above it or something.


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
  •