Question : Multiple Selection buttons passing 2 variables

In a previous post, an expert helped me to make Selection buttons for my record listing.  A Button will appear on every line and the user can simply click the button next to the record to make their choice.

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/Q_26372053.html

I'd now like to add 3 buttons per line:
So instead of 1 button, I'd like to add 2 more buttons on the same line.

I tried to modify this function which worked correctly when passing 1 variable:
<script>
function _submit(teamid) {
document.form.teamid.value=teamid;
}</script>

To this in an attempt to pass a second variable unique to the button being pushed:

<script>
function _submit(teamid,selection) {
document.form.teamid.value=teamid;
document.form.selection.value=selection;
}</script>

Then for each of the buttons, I modified this:
<input type="submit" value="Top10" onclick="_submit(<?=$teamnum?>)";>

To this for the second variable:
Button 1:
<input type="submit" value="Top10" onclick="_submit(<?=$teamnum?>,Top10)";>
Button 2:
<input type="submit" value="Top20" onclick="_submit(<?=$teamnum?>,'Top20)";>
Button 3:
<input type="submit" value="Skip" onclick="_submit(<?=$teamnum?>,'Skip)";>

Ever since I added 2 variables to this functions for multiple buttons, no data is being added to my data and I'm unable to echo the results.

I don't get any Syntax errors though.

Can someone help me correctly process 2 variables in these buttons?

Thanks,

-Dan

Answer : Multiple Selection buttons passing 2 variables

Everything else looks good.  Did you try again after fixing the single quotes issue I listed above?  I tested like this (and the alert box shows the proper data):
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script>
function _submit(teamid,selection) {
document.form.teamid.value=teamid;
document.form.selection.value=selection;
}
function validateForm(frm) {
	alert(frm.teamid.value + "\n\n" + frm.selection.value);
	return false;
}
</script>
</head>

<body>
<form name="form" action="" method="post" onsubmit="return validateForm(this);">
<input type="submit" value="Top10" onclick="_submit('team123','Top10');">
<input type="submit" value="Top20" onclick="_submit('team123','Top20');">
<input type="submit" value="Skip" onclick="_submit('team123','Skip');">
<input type="hidden" name="teamid" />
<input type="hidden" name="selection" />
</form>
</body>
</html>
Random Solutions  
 
programming4us programming4us