Solved

Resend form data without confirmation via javascript.

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
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)

738 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