Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe your two major options are to (1) perform the numeric calculation on the client-side and update the input box directly, or (2) perform an Ajax request and use the response from the server to update the text box in a similar fashion.</p> <p>Here are some more details and some examples/links to hopefully get you started.</p> <h2>1. Perform the calculation on the client side.</h2> <p>I assume you are currently submitting a form when upon clicking the button that rolls for the stat; instead. you can set up the button click so that it calls a JavaScript function you've defined on your page that performs the same calculation that you would normally perform on the server.</p> <p><a href="http://jsfiddle.net/BinaryMuse/StDYq/2/" rel="nofollow noreferrer">Here's a simple example</a> that uses jQuery to attach click-handlers to the buttons and updates the values.</p> <h2>2. Perform the update via Ajax</h2> <p>By default, when you submit a form, the page refreshes and is replaced with the complete response from the server. Ajax allows you to submit data to the server <em>in the background</em>, and then get data back from the server which you can use to update your web page, <em>without</em> a refresh.</p> <p>For more information, you may want to check out these links:</p> <ul> <li><a href="https://stackoverflow.com/questions/5373987/how-to-use-jquery-ajax-calls-with-node-js">how to use jQuery ajax calls with node.js</a> on Stack Overflow</li> <li><a href="https://stackoverflow.com/questions/6317219/ajax-to-refresh-a-partial-view-using-express-and-jquery">Ajax to refresh a partial view using express and JQuery?</a> on Stack Overflow</li> <li>jQuery <a href="http://api.jquery.com/jQuery.ajax/" rel="nofollow noreferrer">ajax</a> and <a href="http://api.jquery.com/jQuery.getJSON/" rel="nofollow noreferrer">getJSON</a> documentation</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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