Yapapaya / jquery-cloneya

A jquery plugin to clone DOM elements
MIT License
76 stars 28 forks source link

Clone tr #48

Open ntanas72 opened 8 years ago

ntanas72 commented 8 years ago

Hi,

i am trying to clone form elements that are inside tr and its not working at all

I have use your simple-clone example using table

Here is the code

    <div id="simple-clone-tr" class="demo-wrap">

        <h2>Simple Cloning</h2>
        <form class="form" method="post">   
            <table>
                <tr class="toclone">
                    <td class="name"> 
                        <input type="text" name="name[]" id="sname" /> 
                        <label for="name">Name</label> 
                    </td> 

                    <td class="email"> 
                        <input type="text" name="email[]" id="semail" /> 
                        <label for="email">E-mail</label> 
                    </td> 

                    <td class="web"> 
                        <input type="text" name="web[]" id="sweb" /> 
                        <label for="web">Website</label> 
                    </td> 
                    <td>
                        <a href="#" class="clone">clone</a> 
                        <a href="#" class="delete">delete</a>
                    </td> 
                </tr>
            </table>

        </form>

    </div>
    <!--simple clone demo end-->

I have add the js for the clone

$('#simple-clone-tr').cloneya();

I have notice that the plugin adds the .cloneya-wrap class to the wrapper and the .cloneya to the .toclone element but when i press clone nothing happens

Is something wrong with the code, with my approach ?

Please let me know how to solve this problem.

chasegiunta commented 8 years ago

Any table elements used in the container seems to be break this plugin.

actual-saurabh commented 8 years ago

I have not considered tables while building the plugin, so not tested it at all. Would you be kind enough to put this on a jsfiddle or something or helping out with the tests? Otherwise, I would have to push this to a future version.