Link to home
Start Free TrialLog in
Avatar of cadwal01
cadwal01

asked on

Javascript Alert Popup on ItemUpdated

Need to have an alert fire after a formview updates.  Here is the code I have which is not working.
script language='javascript' type='text/javascript'> 
 
function confirmSelection() 
{ 
if (Page_IsValid) 
{ 
return confirm('Are you sure you want to delete this record?'); 
} 
else 
{ 
return false; 
} 
} 
 
</script> 
 
2. In your Page_Load event handler, add this line:
 
Me.fvLog.Attributes.Add("ItemUpdated", "return confirmSave()")

Open in new window

Avatar of cadwal01
cadwal01

ASKER

Slight correction, I do have both the function names the same in my code.
So say you have a button Update in your FormView EditItemTemplate to update then try this:

<asp:Button ID="btnUpdate" CommandName="Update" runat="server" OnClientClick="return confirm('Are you certain you want to update?');" Text="Update" />
I want to give the user confirmation that the record has been saved/added.  They want a visual cue fro some reason.  So this would be after the ItemUpdated event.  Perhaps a hidden button with tthis code attached?
ASKER CERTIFIED SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial