tater
06-23-2004, 05:31 PM
in the code below $firstSelect and $secondSelect contain the names of select fields in the form someForm. I am needing to use the name of the second select field in the function. where there is a :confused: i need a reference to the name of the second select field
Thanks
in function
function makeFirstOptionNull( :confused: )
{
document.someForm. :confused: .options.value = null;
document.someform.submit();
}
in body
<form name="someForm" method="post" action="itself.php">
<input type="hidden" name="itemCount" value="
<? if ($_SERVER['REQUEST_METHOD'] == 'GET')
{
$itemCount = 1;
echo $itemCount;
}
else
echo $_POST['itemCount'];
?>">
<? if ($_SERVER['REQUEST_METHOD'] == 'GET')
$itemCount = 1;
else
$itemCount = $_POST['itemCount'];
for ($lineItem = 1; $lineItem <= $itemCount; $lineItem++)
{
$firstSelect = "firstSelect".$lineItem;
$secondSelect = "secondSelect".$lineItem; ?>
<select name="<? echo $firstSelect ?>" onChange="makeFirstOptionNull(<? echo :confused: ?>)"></select>
<select name="<? echo $secondSelect ?>"></select>
Thanks
in function
function makeFirstOptionNull( :confused: )
{
document.someForm. :confused: .options.value = null;
document.someform.submit();
}
in body
<form name="someForm" method="post" action="itself.php">
<input type="hidden" name="itemCount" value="
<? if ($_SERVER['REQUEST_METHOD'] == 'GET')
{
$itemCount = 1;
echo $itemCount;
}
else
echo $_POST['itemCount'];
?>">
<? if ($_SERVER['REQUEST_METHOD'] == 'GET')
$itemCount = 1;
else
$itemCount = $_POST['itemCount'];
for ($lineItem = 1; $lineItem <= $itemCount; $lineItem++)
{
$firstSelect = "firstSelect".$lineItem;
$secondSelect = "secondSelect".$lineItem; ?>
<select name="<? echo $firstSelect ?>" onChange="makeFirstOptionNull(<? echo :confused: ?>)"></select>
<select name="<? echo $secondSelect ?>"></select>