Rod Weir
going with the flow Posts:44
|
10-03-2010 04:18 PM |
|
Hi Nukers,
I have configured a very simple feedback form and just want to display a message box that says "Thank you", and clear the contents of the form, without having to redirect to another page.
Using DNN5.5 and DF3.1
Can this be done?
Thanks,
Rod |
|
Helpdesk Software |
|
|
Ryan Bakerink
river guide Posts:1900
|
10-04-2010 07:37 AM |
|
Hello Rod,
Yes this can be accomplished by going to Module Configuration -> Custom JavaScript File and place the javascript you wish to use to display a message to the user by placing this into the Submit/Javascript textarea box.
If you have any questions please let me know.
Thanks,
Ryan |
|
|
|
|
Rod Weir
going with the flow Posts:44
|
10-04-2010 02:39 PM |
|
Thanks Ryan, I was hoping for a non-development way of doing what I would imagine to be one of the most basic, simple things a form system should be able to do. It never ceases to amaze me that in order to get DNN to do just about anything (whether using the core product, or 3rd party control), you need to be a developer. I guess I'll start learning Javascript now.... Thanks, Rod |
|
Helpdesk Software |
|
|
Candace
river guide Posts:2431
|
10-04-2010 02:49 PM |
|
Hi Rod,
You might consider using the "Display after Save message" from Module Configuration and set up the message in System Messages. When this is done, just set your redirect back to your Dynamic Forms page. You may need to add the actual URL in the redirect setting. Using this combination, your user will see your thank you message and when they hit continue, they'll go back to the same DF page.
It will involve a redirect but will be transparent to your user as it's going back to the same page. I hope that's a viable alternative for you. Thanks!
Candace
|
|
|
|
|
Rod Weir
going with the flow Posts:44
|
10-04-2010 02:59 PM |
|
Thanks Candace - I'll give this a try. Is this a system-wide setting? In other words, if I try this, are all of my dynamic forms going to exhibit this behaviour? Thanks, Rod |
|
Helpdesk Software |
|
|
Candace
river guide Posts:2431
|
10-04-2010 03:09 PM |
|
No, this is instance-specific so only the instance you're working with will display the message. Candace |
|
|
|
|
Rod Weir
going with the flow Posts:44
|
10-04-2010 06:26 PM |
|
Thanks Candace - this is exactly what I was after. Works great. Oh, and Ryan, I learnt how to how to write a Javascript message box. I think I might be ready for DNN module development now ;-) |
|
Helpdesk Software |
|
|
Candace
river guide Posts:2431
|
10-05-2010 07:04 AM |
|
Glad you got it working, Rod! On to the next item on your project list.... |
|
|
|
|
Ken Maudsley
going with the flow Posts:33
|
10-11-2010 10:18 AM |
|
Rod, if you implemented the javascript solution, do you mind sharing that code here? |
|
|
|
|
Rod Weir
going with the flow Posts:44
|
10-11-2010 01:45 PM |
|
Ken, it was just a very simple alert("Thank you") in the Java text box. I found this great site for learning a bit of JavaScript http://www.w3schools.com/js/js_popup.asp Hope this helps. Perhaps someone with better JS knowledge can chip in here. In the end, I used the solution Candace proposed and it was just what I was looking for. Best regards, Rod |
|
Helpdesk Software |
|
|
Ryan Bakerink
river guide Posts:1900
|
10-15-2010 09:20 AM |
|
Hello Ken,
If you need a little assistance with JavaScript let me know and maybe I can help you with a script or point you to a URL that can help you.
If anyone has any questions please let us know.
Thanks,
Ryan |
|
|
|
|
Ken Maudsley
going with the flow Posts:33
|
10-15-2010 09:25 AM |
|
The javascript for that was very simple. But I didn't like how it worked. When you click Submit, the javascript alert window opened immediately and when you close it then the page refreshed. What I really would like is for the form submission to happen and then a message either on the page or as an alert, let the user know that the form was submitted. I ended up using the redirect to a URL confirmation page, but would like to know if the alternative I describe is possible. |
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
10-15-2010 10:21 AM |
|
Hello Ken,
We do have a feature called Display Message to User After Initial Save.
You can go to Module Configuration-> General Settings you'll find a check box labeled: "Display Message to User After Initial Save", check this checkbox.
Now move to Module Configuration -> Header/Footer/System Messages
This is on the same page, it's another expandable menu.
You'll see a drop down list, select from it "Display Message to User" or it says something very familiar to this. Then use this template to construct your successful message to the user if the form is successfully submitted.
Make sure you disable any redirection form completion events, or else it may not work.
Please let me know if you can get this feature to work.
Thanks,
Ryan |
|
|
|
|
Paul
going with the flow Posts:31
|
02-19-2013 05:07 AM |
|
I also have been working on adding a "feedback" form to some of my website pages. I have one form that I include on each page so all the data collects in one DB that I can export. The only problem I have is capturing the current page I am on. I figure I would add a hidden field and update it with the current page, but how would I get the current page I'm on? |
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
02-20-2013 06:37 AM |
|
Hello Paul, You can always use JavaScript to discover the page that you're currently on in your site: document.URL You can learn more about this by visiting this resource: http://www.w3schools.com/jsref/prop_doc_url.asp After obtaining the URL you can add in some conditional JavaScript based on the URL collected via JavaScript. Please let me know if you have any questions. Thanks, Ryan |
|
|
|
|
Paul
going with the flow Posts:31
|
02-20-2013 11:22 AM |
|
I'm not sure how to get it into the hidden field. Which setting do I use? |
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
02-20-2013 12:17 PM |
|
Hello Paul, Perhaps your Hidden Field Shortfield name is "MyHiddenField". Then under Module Configuration -> Advanced Coding Options -> Custom JavaScript file -> Initial JavaScript, you could provide the following JavaScript: $(MyHiddenField) = document.URL; Your hidden field should now contain the value of the current page you're on upon page load. Please let me know if you have any questions. Thanks, Ryan |
|
|
|
|
Paul
going with the flow Posts:31
|
02-21-2013 04:33 AM |
|
Worked perfectly. Thanks again! |
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
02-21-2013 04:55 AM |
|
Great to hear. Let us know if you ever have any questions. Thanks, Ryan |
|
|
|
|