robert_gsfame Posted April 28, 2010 Share Posted April 28, 2010 I have two form n i wish to move the record from first form to another form var lengthx=document.form4.elements.length; var length=document.form3.elements.length; var choosex=""; for(var x=0;x<lengthx;x++){ if(document.form4.elements[x].type=="checkbox"){ for(var y=0;y<length;y++){ if(document.form4.elements[x].value!==document.form3.elements[y].value){ choosex=choosex+"<tr><td>"+document.form3.elements[y].value+"</td></tr>";}}}} document.getElementById("datauser").innerHTML="<form name=form4><table width=357>"+choose+"</table></form>"; } when i choose one record from form3, everything goes correctly...but when i choose more records at the same time then records in form3 duplicate so if let say i have 4 records and i choose 2 records then i will have 8 records which part of looping is incorrect?? thx Link to comment https://forums.phpfreaks.com/topic/200016-loop-problem/ Share on other sites More sharing options...
Ken2k7 Posted April 28, 2010 Share Posted April 28, 2010 I don't know why phpfreaks put a bolded-red statement stating users to read the rules before posting when everyone ignores it. Read #4 of Forum DOs. Link to comment https://forums.phpfreaks.com/topic/200016-loop-problem/#findComment-1049924 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.