Solved

Resend form data without confirmation via javascript.

Posted on 2011-03-15
3
2,825 Views
Last Modified: 2012-05-11
I have a simple process that clears a content cache.  On the callback of the confirm, the page reloads.  When the page reloads, the standard "are you sure" message pops up asking the end user if they want to reload and resend the form contents.  Is there anything that I can add to the script that would tell the browser not to bother asking, since they have already confirmed clearing the cache, which requires reloading the page to rebuild the cache from the db?

The key would be here:
function callback(text){
      location.reload(true);     /////tell it not to ask.....
}

TIA!
<script>

	function submitForm() {
		$("#dialog-confirm").dialog({
			resizable: 0,
			height:		175,
			width:		483,
			modal:		1,
			position:	[500,250],
			buttons: {
				'Clear Script/Template Cache': function() {
					ColdFusion.Ajax.submitForm('clearCacheForm', '<cfoutput>#request.url#</cfoutput>admin/<cfoutput>#request.thisModule#</cfoutput>/act/act.clearCache.cfm', callback, errorHandler);
					$(this).dialog('close');
				},
				Cancel: function() {
					$(this).dialog('close');
					$("#accordion").accordion("activate", 0);
				}
			}
		});
	}

	function callback(text){
		location.reload(true);
	}

	function errorHandler(code, msg) {
		alert("Error!!! " + code + ": " + msg);
	}

</script>

Open in new window

0
Comment
Question by:brianmfalls
[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
3 Comments
 
LVL 7

Accepted Solution

by:
Gewgala earned 300 total points
ID: 35142522
I don't believe this is something you can control, and would fall outside the scope of Javascript's capabilities.  For security reasons the browser asks the user if they want to resend.
0
 
LVL 4

Assisted Solution

by:dwkd
dwkd earned 200 total points
ID: 35142525
I dont think you can re-post a form without user's permission. I think it's a browser security measure

Have you tried doing it through an AJAX request? and not have to reload
0
 
LVL 1

Author Comment

by:brianmfalls
ID: 35142599
The overall process is pretty complex.  Unfortunately, we can't leverage Ajax any further than what we have already done.  I figured that it wouldn't be anything that we could control.  Still, it was worth asking.  Thanks guys.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 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