Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6566665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:14:37+00:00 2026-05-25T14:14:37+00:00

Quick Express.js question. I’ve been building a simple rpg charactersheet app over the past

  • 0

Quick Express.js question. I’ve been building a simple rpg charactersheet app over the past couple of days to get my feet wet with node, express and web programming in general. Anyway I’m stuck on something that I suspect is simple but I haven’t been able to find an answer to yet. Basically I have a form built that holds stat values so let’s say x, y, z. OK, then I have a button that rolls against one of those stats, basically rolling dice and adding x, y, or z depending and returns the value. All right, everything up to that works fine what I’m getting stuck on is figuring out how I can refresh a single input textbox without clearing the rest of the form, specifically when I return the di roll I want to input that value in the ‘results’ textbox but keep the values static in x, y, z.

I’ve tried a few different things like putting the result textbox on it’s own partial and rendering that partial but that then removes the rest of the page (rendering only that partial) I can render the entire index and get the result to populate but that wipes the rest of the values for x, y, z.

In a case like this what’s the best practice to achieve that goal? Should I write out the values for x, y, z to an array and pass them back when I pass back the results? I’m quite sure that would work but it doesn’t seem like the most efficient way to do things.

Should I be implementing the refresh of the results box on the client side instead after the server’s returned the results? If so how would I do that?

Thanks,
logos

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:14:37+00:00Added an answer on May 25, 2026 at 2:14 pm

    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.

    Here are some more details and some examples/links to hopefully get you started.

    1. Perform the calculation on the client side.

    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.

    Here’s a simple example that uses jQuery to attach click-handlers to the buttons and updates the values.

    2. Perform the update via Ajax

    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 in the background, and then get data back from the server which you can use to update your web page, without a refresh.

    For more information, you may want to check out these links:

    • how to use jQuery ajax calls with node.js on Stack Overflow
    • Ajax to refresh a partial view using express and JQuery? on Stack Overflow
    • jQuery ajax and getJSON documentation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick question, hopefully I am just missing something simple. Ok I have one class
Quick embrassing question. I have been looking for a PHP function that would calculate
Quick and should be simple question, but i cant find the answer!!! So im
Quick question, I am working on an APNS enabled app and I just want
Quick question: How do I get a pointer to a pre-declared function in javascript.
I need to create a quick-n-dirty knob control in Visual Basic 2005 Express, the
Quick question. What do you think, I have a few sites that use a
Quick question: Would it be a good or a bad idea to implement my
Quick question: what is the compiler flag to allow g++ to spawn multiple instances
Quick design question. ClassA has a method called DoSomething(args) In DoSomething(), before it can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.