View Full Version : Show array of messages to user

09-23-2012, 05:05 PM
Folks, i have the following scenario. Hope you can help me with.

On HTML page i have several checkboxes.
Then by clicking in a button i call for a javascript function that scan all checkboxes and build a array with the checkboxes values.

Now i want to display to the user the content of this array. It can be as ALERT (with multiple lines) or send the content of the array to another blank page.

Can someone help me with an example on how to achieve this ?


09-23-2012, 06:15 PM
Despite the similar sounding names, Java is not the same as Javascript.
Moving from Java forum to Javascript forum.

09-23-2012, 07:17 PM
a simple example...

<input type="checkbox" value="hi" onclick="addMess(this)"/><br>
<input type="checkbox" value="bye" onclick="addMess(this)"/><br>
<input type="checkbox" value="later" onclick="addMess(this)"/><br>
<input type="button" value="show me" onclick="alert(str)"/>
<script type = "text/javascript">
var str=""
function addMess(box){