But it seems like it's not changing at all.
$('.test').click(function() {
for(var i=0;i<$("li.songs").length;i++)
{
var ob = $("li.songs").eq(i).clone();
ob.find('input').each(function()
{
this.name = this.name+i;
alert(this.name); //just checking if does it change
});
}
});
now, the alert displays the right name i want, BUT no changes on the name when I inspect the element AND try to submit the form and display all the POST values. Any help ??
example expected output:
[Before changing]
<li class="songs"><input type="text" name="song" /></li>
<li class="songs"><input type="text" name="song" /></li>
<li class="songs"><input type="text" name="song" /></li>
[After Changing]
<li class="songs"><input type="text" name="song1" /></li>
<li class="songs"><input type="text" name="song2" /></li>
<li class="songs"><input type="text" name="song3" /></li>
NOTE:!!
I DONT WANT THE input named song to be an ARRAY. just telling you from the start.. XD

New Topic/Question
Reply



MultiQuote





|