I have a form that is dynamically built as a result of a query.
You can make changes to all the items in each row then post to an array that loops and updates.
I have a condition that needs to be checked. If there is no total for a line item, I need to (preferably) bring up a prompt asking for current reading for this item.
I have never used a prompt. I do not know how to access the value entered. Also would like for it to not have a cancel button as this is a required step. And I need for this prompt to know which line item it is associated with. Expecting too much? I tried to format the code from the cut and paste but gave up.
[code]
<script>
/*function to check if our item’s total is null then we need to bring up a popup for current hobbs*/
function TotalCheck(temp) {
if (temp.value == “”)
prompt(“Enter current Hobbs reading”); }
</script>
<form name=moditems>”;
for ($i = 1; $i <= @mysql_num_rows($itemresult); $i++)
{
$itemrow = @mysql_fetch_array($itemresult);
<select name=unit_item$i onfocus=”return UnitSet(document.moditems.unit_tr$i);” onchange=”return TotalCheck(document.moditems.total$i);”>
<option value=””>—-“;
for ($j = 1; $j <= 25; $j++)
{
if ($itemrow[“UnitTR_ItemNo”] == $j)
$value .= “<option value=”.$j.” selected>”.$j;
if ($itemrow[“UnitTR_ItemNo”] <> $j)
$value .= “<option value=”.$j.”>”.$j;
}
$value .=”</select>
}
Thanks for any help or suggestions.