Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script><script language="javascript">
- $(document).ready(function(e) {
- $("#sbtUser").on('click',function(){
- var name = $("#name").val();
- var org = $("#organisation").val();
- var city = $("#city").val();
- if(name == '' || org == '' || city == '')
- {
- alert('Please Provide Name, Organization and City values');
- }
- else
- {
- $(this).attr('disabled', 'disabled');
- var str = $("form").serialize();
- $.ajax({
- type:"GET",
- url:"submit.cfm",
- data:str,
- success:function(html) {
- $("#message").html(html);
- }
- });
- }
- });
- });
- </script>
- <input type="text" id="testString" placeholder="Enter test string">
- <button id="sbtUser">Test</button>
- </body>
- </html>
- other Page submit.cfm, i just did like this
- <cfsetting showdebugoutput="no">
- <cfsavecontent variable="a">
- #url.testString#
- </cfsavecontent>
- <cffile action="write" file="#ExpandPath("excel")#\#Dateformat(now(),'dd_mm_yyyy')#_#TimeFormat(now(),'hh_mm_ss_tt')#.xls" output="#a#">
- Thanks For your Survey, we have stored Your Information
- That's it, it created excel on fly and stored it on the PC and showed a message to user without page refresh
- Cheers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement