Welcome Guest, Not a member yet? Register   Sign In
Get value of clone element
#1

[eluser]Beginers[/eluser]
Hi people how do i get the value of my clone form elements and its value of the same name?
here is my code:

Code:
<tbody>
<tr class="tbl-border" id="prev">
                            <td align="center">&lt;input type="text" name="part" id="part" /&gt;&lt;/td>
                            <td align="center">&lt;input type="text" name="qty"   id="qty" /&gt;&lt;/td>
                            <td align="center">&lt;input type="text" name="serial"   id="serial" /&gt;&lt;/td>
                            <td align="center">&lt;input type="text" name="repair"   id="repair" /&gt;&lt;/td>
                            <td align="center">&lt;input type="text" name="note"   id="note" /&gt;&lt;/td>
                        </tr>
</tbody>

jquery
Code:
$('a[name=modal]').click(function(e) {
    
       var cloned = $("#prev").clone();
       cloned.insertAfter("table > tbody.tbody > tr:last").hide().fadeIn(1000);
#2

[eluser]Aken[/eluser]
You can't have multiple form items with the same name. The last one will always be the ending value - they'll be overwritten in order that they appear in the markup.

You'll have to use array notation, such as part[] if you want to get multiple values.
#3

[eluser]Beginers[/eluser]
@aken ahhh so i need to change my name into an array... thanks i'll try to make it out.
#4

[eluser]Beginers[/eluser]
@aken hi aken i did it!!!! thanks to you... you give an idea on how to manipulate it, at first when i try to display the format using var_dump it only displays the last value of the same name ... thank you Smile god bless you




Theme © iAndrew 2016 - Forum software by © MyBB