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,021 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

726 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