Inmagic Forums
Inmagic Forums
WebPublisher PRO
Customize "Your record has been added" page? / Submit button send an email too?|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
Hello! Is there a way to customize the page a user sees after they have added a record to a textbase using an online edit form? It would be great if we could have it redirect to a page we fully designed (so we could add graphics and such to it). But if that's not possible, at the very least, I assume we could change the part that says "Your record was added" by changing the WPEngMsg.ini file, right? But we don't want the change to apply to ALL our textbases -- just to one. Can I just copy WPEngMsg.ini to WPEngMsg2.ini and have the one edit form refer to the 2 version instead of the master? If so, where/how do I reference that in the edit form?
Also, is there a way to have the "Submit" button on an online edit form not only submit the data to the textbase, but also send us an email that lets us know a new record has been added? The email doesn't have to say anything in the message body -- it just needs a subject line that tells us a new record has come in so we can go check it out. Anybody have any suggestions on that? Thanks! --Meg Alcohol & Drug Abuse Institute University of Washington |
|||
|
Regarding your first question: yes, there is a way. And it's a really FUN way. Well, I had fun. Your mileage may vary.
The high-level overview goes like this: 1. Create a copy of iwpp-edit.asp, the page which your edit page actually posts to, which does the heavy lifting on edits, and which is what you're looking at when you see the plain-jane edit results. 2. Modify the copy of iwpp-edit so that it redirects to a pretty page URL based on textbase and success/failure, passing on any success/failure message. 3. Make a pretty success page and a pretty failure page. Add javascript to pick up success/failure message from query string parameter "msg". 4. Override your edit page's form action to point to the iwpp-edit copy. I made myself an EditHelper.js script which I reference in the edit page. It does the form override work. I also organized things so the iwpp-edit copy can assume the location of the success/failure pretty pages based on the textbase name: \EditHelper [folder] contains: edithelper-iwpp-edit.asp [iwpp-edit copy] EditHelper.js \cars [folder] (matches textbase name) \cars\EditFailure.htm [pretty page] \cars\EditSuccess.htm [pretty page] EditHelper.js
// on page load, change edit form action
addEvent(window, "load", FormAction);
// event listener
function addEvent(o,e,f)
{
if (o.addEventListener){ o.addEventListener(e,f,true); return true; }
else if (o.attachEvent){ return o.attachEvent("on"+e,f); }
else { return false; }
}
function FormAction()
{
document.edit_form.action = "EditHelper/edithelper-iwpp-edit.asp";
}
andornot-iwpp-edit.asp Add the following to the very bottom of iwpp-edit copy. No need to modify anything else on the page.
<%
/************************************************************
Peter Tyrrell, Andornot Consulting
October 2005
*************************************************************/
// Edit redirects based on 1) textbase name 2) success/failure
var textbase = String(objRequest('TN'));
var msg = "";
if (!bRecordProcessed)
{
if (queryError != null)
{
msg = queryError;
}
else if (sQueryAccessErrorText != "")
{
msg = sQueryAccessErrorText + " " + sQueryAccessErrorTextExtra;
}
else if (sRecordErrorText != "")
{
msg = sRecordErrorText;
}
Response.Redirect(textbase + "/EditFailure.htm?msg=" + msg);
}
else
{
Response.Redirect(textbase + "/EditSuccess.htm");
}
%>
Peter Tyrrell, MLIS Senior Consultant Andornot Consulting Inc. http://www.andornot.com/about/developerblog |
||||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|
Inmagic Forums
Inmagic Forums
WebPublisher PRO
Customize "Your record has been added" page? / Submit button send an email too?
