Solved

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

Posted on 2008-10-15
2
1,030 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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

717 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