Onclick multiple choices at same time
Hi I have a similar problem, I have a javascript which can open popup and then passing values onclick.
But my requirement is adding multiple values, current script only add 1 per onclick and if I click another, it deletes previous one and add new 1, how can I add multiple values 1234
Please check following javascript which i uploaded live demo on http://goo.gl/WDNrAZ:
index.html
Code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showList() {
sList = window.open("popup.html", "list", "width=150,height=210");
}
function remLink() {
if (window.sList && window.sList.open && !window.sList.closed)
window.sList.opener = null;
}
// -->
</SCRIPT>
</head>
<body>
<FORM NAME="stockForm">Enter your favorite tech stock:
<INPUT TYPE="text" NAME="stockBox" SIZE="10" VALUE="">
<INPUT TYPE="button" VALUE="list" onClick="showList()">
</FORM>
</body>
</html>
popup.html
Code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showList() {
sList = window.open("popup.html", "list", "width=150,height=210");
}
function remLink() {
if (window.sList && window.sList.open && !window.sList.closed)
window.sList.opener = null;
}
// -->
</SCRIPT>
</head>
<body>
<FORM NAME="stockForm">Enter your favorite tech stock:
<INPUT TYPE="text" NAME="stockBox" SIZE="10" VALUE="">
<INPUT TYPE="button" VALUE="list" onClick="showList()">
</FORM>
</body>
</html>