Solved

Resend form data without confirmation via javascript.

Posted on 2011-03-15
3
2,785 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
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

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

Title # Comments Views Activity
Any Way to rotate banner ads from Commission Junction? 2 36
selected value 16 24
Word Press Fixes to Google Speed Test Issues 2 17
toggle content 12 19
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.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

685 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