I'm using classic asp. I have a form which is filled up by images taken from a db and other type of inputs. If the user clicks on one image, I need to add an item (maybe a string, maybe a number, it's not relevant) to an array and then send it to a classic asp page with all the other values in the form. My code is something like this: (in this case the array is filled by clicking a button)
<script language ="javascript">
var arr = [];
var i = 0;
function aggiungi() {
arr.push(i.toString());
i++;
}
</script>
<html>
<form method ="post" action="save.asp">
<input type ="text" name="nome" />
<input type ="button" onclick="aggiungi()" value ="add"/>
<input type="submit" value ="invia" />
</form>
I wanna send the value in the textbox and the array arr. How can I do?
I would try setting each image item as an HTML checkbox, using the Label element for the actual images; then CSS to hide the actual checkboxes. Also CSS to distinguish the images as checked or not.
Example:
Click the first and third checkboxes. On submit to
test.asp,request.form("images[]")=img1.jpg,img3.jpg