Jump to content

Problem getting clone section to work


neilfurry

Recommended Posts

Hi

Here is my problem

https://jsfiddle.net/mphur5eq/14/

I have two tables on the left section1 on top and section2 at the bottom

each section has its own button to insert row

section 1 has different number of fields than that on section 2.

the problem is when i clicked on New Row on section 2 it clones the row from section 1 which is wrong,

it should clone the row of the section where it belongs.

can you help me with this?

Thank you

Edited by neilfurry
Link to comment
Share on other sites

Your HTML has 4 <tr> elements with an id of 'row', which is wrong from a purely semantic point of view. The point of an id is that (much like Highlander) there can be only one (per page). You've also got 2 'container' ids. You'll find JavaScript and jQuery much easier to deal with if your markup up is syntactically correct, so I'd start looking there. Associate each of the 'new row' buttons with the form by putting the button in the form itself, then you've got a frame within which to work.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.