Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Javascript doesn't have access to writing files in hard drive. However you can capture the data, make a model and then store it in the server using ajax calls.</p> <p>Some ideas:</p> <ol> <li>Use a layout or master page that is rendered throughout the application views.</li> <li>Give same class name for all the page labels, buttons, checkboxes and anything you need to store information about.</li> <li>Use some jquery magic in the master/layout page to get the values of those elements and make an array.</li> <li>Send that array through ajax call to the server. </li> </ol> <p>Now you can get tons of examples of how to get element values using jquery. I'm saving you from giving all that. Hope that helps... :D</p> <p>//edit: i'm trying to extend my answer as per steve requested.</p> <pre><code>&lt;form action="someAction" id="myForm"&gt; Name: &lt;input type="text" class="Name"&gt; Checkbox: &lt;input type="checkbox" class="ChBox"/&gt;Click this box RButton: &lt;input class="Rbutton" type="radio" /&gt; Submit: &lt;input type="submit" class="submit"/&gt; &lt;/form&gt; </code></pre> <p>Now some jquery:</p> <pre><code>$(function() { $(".submit").click(function(){ var dataToSend = new Object(); dataToSend.pageUrl = window.location.pathname + " is displayed"; if ($(".Name").val().length &gt; 0) { dataToSend.Name = "Field Name is set successfully"; } else { dataToSend.Name = "Field Name is empty"; } if($(".ChBox").is(':checked')){dataToSend.ChBox = "ChBox is enabled successfully";} else{dataToSend.ChBox = "ChBox is not enabled";} if($(".Rbutton").is(':checked')){dataToSend.Rbutton = "Rbutton is enabled successfully";} else{dataToSend.Rbutton = "Rbutton is not checked";} dataToSend.Submit = $("#myForm").attr['action'] + " is displayed"; }); //now send it to the server via ajax $.ajax({ type: "POST", url: "your server action url that would make excel file with these data", data: dataToSend, contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { //do as you wish } }); }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload