Click to See Complete Forum and Search --> : Can I retun the value of chck boxes in a hidden input?


gogotina
04-02-2003, 11:20 PM
Is it possialbe to use 20 checkboxes (1 to 20) and 10 radio bottons (1 to 10) to generate the value for "item_name" for a Single Item Purchase with PayPal when they use (<input type="hidden" name="item_name" value=""> )? I want to click on 5 of the 20 checkboxes and 1 radio button and send the value in the (<input type="hidden" name="item_name" value=""> ). I am useing javascript to limt the to five choices
<script language="javascript">

function KeepCount() {
var NewCount = 0
if (document.item1.A.checked)
{NewCount = NewCount + 1}
if (document.item1.B.checked)
{NewCount = NewCount + 1}
if (document.item1.C.checked)
{NewCount = NewCount + 1}
if (document.item1.D.checked)
{NewCount = NewCount + 1}.....
witch workes well. I use a plain radio button<input type="radio" name="item2" value="1">. I want to add the value if item1(witch should be five letters) and the radio button selection and send that as a value for the (<input type="hidden" name="item_name" value=""> ) Can this be done or am I crazy???? Any help would be wounderful.:D

gogotina
04-03-2003, 11:10 PM
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>item_name</title>
</head>
<body>
var hdn = document.item1.item_name
var fld = document.item1.item2
hdn.value = item1 + item2

<script language="javascript">

function KeepCount() {
var NewCount = 0
if (document.item1.A.checked)
{NewCount = NewCount + 1}
if (document.item1.B.checked)
{NewCount = NewCount + 1}
if (document.item1.C.checked)
{NewCount = NewCount + 1}
if (document.item1.D.checked)
{NewCount = NewCount + 1}
if (document.item1.E.checked)
{NewCount = NewCount + 1}
if (document.item1.F.checked)
{NewCount = NewCount + 1}
if (document.item1.G.checked)
{NewCount = NewCount + 1}
if (document.item1.H.checked)
{NewCount = NewCount + 1}
if (document.item1.I.checked)
{NewCount = NewCount + 1}
if (document.item1.J.checked)
{NewCount = NewCount + 1}
if (document.item1.K.checked)
{NewCount = NewCount + 1}
if (document.item1.L.checked)
{NewCount = NewCount + 1}
if (document.item1.M.checked)
{NewCount = NewCount + 1}
if (document.item1.N.checked)
{NewCount = NewCount + 1}
if (document.item1.O.checked)
{NewCount = NewCount + 1}
if (document.item1.P.checked)
{NewCount = NewCount + 1}
if (document.item1.Q.checked)
{NewCount = NewCount + 1}
if (document.item1.R.checked)
{NewCount = NewCount + 1}
if (document.item1.S.checked)
{NewCount = NewCount + 1}
if (document.item1.T.checked)
{NewCount = NewCount + 1}
if (NewCount == 6)
{
alert('Pick Just Five Numbers Please')
document.ticket1; return false;
}
}
</script>
<form name="item1" action="https://www.paypal.com/cgi-bin/webscr" method="Post"><input type="hidden" name="cmd"><input type="hidden" name="business" value="me@mybiz.com"><input type="hidden" name="item_name" value="??????"><input type="hidden" name="amount" value="10.00"><small><input type="checkbox" name="A" onclick="return KeepCount()"></small><small>
1&nbsp;</small><small><input type="checkbox" name="B" onclick="return KeepCount()"></small><small>
2&nbsp; </small><small><input type="checkbox" name="C" onclick="return KeepCount()"></small><small>
3&nbsp;</small><small><input type="checkbox" name="D" onclick="return KeepCount()"></small><small>
4&nbsp; </small><small><input type="checkbox" name="E" onclick="return KeepCount()"></small><small>
5&nbsp;</small><small><input type="checkbox" name="F" onclick="return KeepCount()"></small><small>
6&nbsp; </small><small><input type="checkbox" name="G" onclick="return KeepCount()"></small><small>
7&nbsp;</small><small><input type="checkbox" name="H" onclick="return KeepCount()"></small><small>
8&nbsp; </small><small><input type="checkbox" name="I" onclick="return KeepCount()"></small><small>
9&nbsp;</small><small><input type="checkbox" name="J" onclick="return KeepCount()"></small><small>
10&nbsp; </small><small><input type="checkbox" name="K" onclick="return KeepCount()"></small><small>
11&nbsp;</small><small><input type="checkbox" name="L" onclick="return KeepCount()"></small><small>
12&nbsp; </small><small><input type="checkbox" name="M" onclick="return KeepCount()"></small><small>
13&nbsp;</small><small><input type="checkbox" name="N" onclick="return KeepCount()"></small><small>
14&nbsp; </small><small><input type="checkbox" name="O" onclick="return KeepCount()"></small><small>
15&nbsp;</small><small><input type="checkbox" name="P" onclick="return KeepCount()"></small><small>
16&nbsp; </small><small><input type="checkbox" name="Q" onclick="return KeepCount()"></small><small>
17&nbsp;</small><small><input type="checkbox" name="R" onclick="return KeepCount()"></small><small>
18&nbsp; </small><small><input type="checkbox" name="S" onclick="return KeepCount()"></small><small>
19&nbsp;</small><small><input type="checkbox" name="T" onclick="return KeepCount()"></small>
20&nbsp; <small><br>
</small><br>
<small><input type="radio" name="item2" value="1"></small><small>1&nbsp;</small><small><input type="radio" name="item2" value="2"></small><small>
2&nbsp; </small><small><input type="radio" name="item2" value="3"></small><small>
3&nbsp;</small><small><input type="radio" name="item2" value="4"></small><small>
4&nbsp; </small><small><input type="radio" name="item2" value="5"></small><small>
5&nbsp;</small><small><input type="radio" name="item2" value="6"></small><small>
6&nbsp; </small><small><input type="radio" name="item2" value="7"></small><small>
7&nbsp;</small><small><input type="radio" name="item2" value="8"></small><small>
8&nbsp; </small><small><input type="radio" name="item2" value="9"></small><small>
9&nbsp;</small><small><input type="radio" name="item2" value="10"></small><small>
10&nbsp;</small><input type="image" src="x-click-but01.gif" border="0" name="submit" alt="Make payments with PayPal - it&apos;s fast, free and secure!"></form>

</body>
</html>