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

  • SEARCH
  • Home
  • 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 7822981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:05:24+00:00 2026-06-02T08:05:24+00:00

On my form there are a few input fields, once the users entered the

  • 0

On my form there are a few input fields, once the users entered the values into the input field and hit submit, I want the values to populate a few corresponding elements.

How can I do it using jQuery without refreshing the page?

<form method="get">
  <label for="yourName">Your name</label>
  <input name="yourName" id="yourName" type="text">
  <button type="submit">Submit</button>
</form>
<div id="result">
  <span class="rName"></span>
</div>

Some failed JS.

$('#hCardForm').submit(function() {
  var rName = $('#yourName').val();
  $('.rName').text(rName);
});
  • 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-06-02T08:05:26+00:00Added an answer on June 2, 2026 at 8:05 am

    There are 2 things wrong with your code.
    1. you don’t have an id on your form
    2. you are not stopping the submit of the form.

    You could change the button type equal to button instead of submit and submit the form via jquery.

    jsfiddle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few input fields in a form which are submitted using Save
My html form has a few input text fields which can potentially get characters
I have a form with a few fields. When you submit the form, the
I have a basic PHP form (a few fields and 2 checkboxes, I want
For this particular existing form there is an input to accept phone numbers. It
I'm trying to create a registration form. In this form there are some fields(username,password
in a form if there is a field and a global error both messages
I have a basic form consisting of input fields as well as a file
I want to design an app that needs user to input few things like
I have a form with a field that may have zero to multiple values

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.