Bruce Gust
asked on
How can I prevent my page from reloading after the "alert?"
Here's my code:
Basically, if the user attempts to add a record that's a duplicate of what's already in place, they get an alert and the insert code doesn't fire.
Problem is, I don't want the page to reload. Is there a way to structure my code where the checkboxes that had been checked remain so rather than the page reloading?
$workqueueroleassigncheck = cer_workqueueroleassigncheck($tmp_entity[$i]["entityid"], $EntityID, $tmp_user[$k]["userid"]);
if($workqueueroleassigncheck["count"]>0)
{
print '<script type="text/javascript">';
print 'alert("be careful not to assign a role to the same person twice...!")';
print '</script>';
}
else
{
$workqueueroleassignsave = cer_workqueueentityassignsave($tmp_role[$j]["roleid"],$tmp_entity[$i]["entityid"],$EntityID, $tmp_user[$k]["userid"], $updateuserid);
}
Basically, if the user attempts to add a record that's a duplicate of what's already in place, they get an alert and the insert code doesn't fire.
Problem is, I don't want the page to reload. Is there a way to structure my code where the checkboxes that had been checked remain so rather than the page reloading?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If ASP.NET, do you have your controls set to auto-postback?