somedude Posted January 12, 2007 Share Posted January 12, 2007 Hello.I have some dynamic checkboxes and corresponding textboxes.[code]while($row=mysql_fetch_array($result2)){<td ><br/><br/><inpu t type="checkbox" name="valhere[]" value="<? echo $row[dec]; ?>"><? echo $row[dec]; ?></p></td><td width="53%" colspan="8"><input name="varv[]" value="" >[/code]When a user ticks a checkbox and enters data into the corresponding textbox and submits, the value of the checkbox and textbox should be inserted into the database. I can insert the checkbox values perfectly, but the textbox values have issues.[code]while (list ($key,$val) = @each ($dec)) {list ($key,$val2) = @each ($varv);[/code]That code will only input the ticked checkbox values perfectly, but if i've ticked checkbox 1, 3 and 5 (of the dynamic checkboxes) it loops 3 times and will only insert values from TEXTBOX 1,2,3 INSTEAD OF 1, 3, 5.Can anyone point me in the right direction here? Thankyou gentlemen. Link to comment https://forums.phpfreaks.com/topic/33845-insert-checkbox-val-textbox-val-into-db/ Share on other sites More sharing options...
Jessica Posted January 12, 2007 Share Posted January 12, 2007 Well I was going to help, but I'm a lady. Guess I'm out. Link to comment https://forums.phpfreaks.com/topic/33845-insert-checkbox-val-textbox-val-into-db/#findComment-158824 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.