?
Solved

Add a notification pop-up to a save or cancel button within a Data Form Web Part

Posted on 2008-10-15
2
Medium Priority
?
1,046 Views
Last Modified: 2013-11-18
I have a need for a notification box to appear simply stating 'your submission has been received' when a user submits an item within a SharePoint Data Form Web Part.  Currently I redirect a user back to /default2.aspx which is an exact replica of /default.aspx except that I have added this script to /defaul2.aspx

<script type="text/javascript" language="JavaScript">

alert("Your Submission Has Been Received");

</script>

This accomplishes what I want, however if we make a change to default.aspx we also have to change default2.aspx, which we would rather not have to do.  Also I would like to see the popup before the redirect.  Is there some code that I could add to the input button onclick event to get an alert after the __commit and before the __redirect
<input type="button" value="Save" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={/default2.aspx}')}" />

Open in new window

0
Comment
Question by:DataBridge
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Expert Comment

by:deiaccord
ID: 22738703
You could try this

Add the below script which will display an alert before the update method is called. (based on an example here http://edinkapic.blogspot.com/2007/10/add-javascript-date-validation-into.html )

<script language="javascript" type="text/javascript">
function PreSaveAction()
{
    alert("Your update has been recieved");
    return true;  // OK to proceed with the save item
}
</script>



why does default2 need to be a copy of default however. Why not just direct them to a completely new page that just says your submission has been received with a link back to the main page?
0
 

Accepted Solution

by:
DataBridge earned 0 total points
ID: 22739905
Well the thing is, my boss wanted to see the confirmation alert before the page was redirected, in other words, while the information that was input is still on the screen.  Anyway I did some playing around and stumbled across the syntax that got me exactly what I wanted.

<input type="button" value="Save" name="btnSave" onclick="javascript:alert('Your Submission Has Been Received');{ddwrt:GenFireServerEvent('__commit;__redirect={/}')}" />
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question