<script>
var itemsAdded = Array();
function moveNumbers(text) {
var i = itemsAdded.indexOf(text)
if ( i >= 0) {
itemsAdded.splice(i,1);
} else {
itemsAdded.push(text);
}
document.getElementById("list").value=itemsAdded.join("");
}
$(function() {
for (i=0;i<10;i++) {
console.log(i);
$("body").append("<input type='checkbox' id='list' name='list' value='"+ i +"' onclick='moveNumbers(this.value)'/> Checkbox"+ i +"<br/>");
}
});
<legend>5x7</legend>
<input type="text" name="list" id="list" style="width:800px; background:#B0D2D7">
<legend>Print size</legend>
<input style='width:20px; height:20px; background-color: #ff6633;'
type='checkbox' id='list' name='list' value='$file - 5x7,'
onclick='moveNumbers(this.value)'>5x7
Hi all, new at this stuff so here goes, I have this so far which all works fine. It displays check boxes next to images that are displayed on web page via a PHP script. When checked it displays the file name and the image print size inside of a text box.
I tried to add more check boxes / text boxes with another print size say 6x8 and repeat the script with some changes. It sort of worked but not correctly. Any ideas would be great! Cheers.