/    Sign up×
Community /Pin to ProfileBookmark

prompt to dynamic form

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>
}
[/code]

Thanks for any help or suggestions.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@tripwaterauthorMay 12.2004 — Maybe take the value from the prompt (or poup if I have to) and set it to a hidden field that is in that line item's row?
×

Success!

Help @tripwater spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...