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 6749601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:42:35+00:00 2026-05-26T12:42:35+00:00

Hi i have a form in my application where user can put their details.

  • 0

Hi i have a form in my application where user can put their details. My form portion looks like this,

http://jsfiddle.net/2MSXP/

in this when user click on add school hyperlink, i want all values appended into label like,

School: 12th

School Name: St. Xavier’s

School Location: Banglore

Class Year: 2010

Branch: Science

This should be appended any no of time when user click on add school hyperlink.

How can i do that using javascript/ jquery?

  • 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-26T12:42:36+00:00Added an answer on May 26, 2026 at 12:42 pm

    The values in the text boxes can be accessed by document.getElementById('id').value

    The remaining should be easy for you to figure out.

    Here’s how you could do it not using JQuery:

        <a href="javascript:show()">Add School</a>
        <script type="text/javascript">
            function show()
            {
                document.getElementById('result').innerHTML = "School Name: " + document.getElementById('sch1').value; 
            }
        </script>
    

    Add a span or div with the id result wherever you want the result to show.
    Expand on the code above to display the other fields as well.

    have a look at this:
    http://jsfiddle.net/GQdsD/

    innerHTML overwrites what was held in the HTML container before. You can do this:

    document.getElementById('result').innerHTML = "School Name: " +
    document.getElementById('sch1').value + "<br/>Location: " + 
    document.getElementById('schloc1').value + "<br/>Year: " + 
    document.getElementById('schoolyear').value + "<br/>Branch: " + 
    document.getElementById('branch1').value;
    

    OR, collect the values in a JS var and then write it to the HTML container:

    var result = "School Name: " + document.getElementById('sch1').value + 
    "<br/>Location: " + document.getElementById('schloc1').value + 
    "<br/>Year: " + document.getElementById('schoolyear').value + 
    "<br/>Branch: " + document.getElementById('branch1').value;
    
    document.getElementById('result').innerHTML = result;
    

    To allow multiple adds, change this line in your code:

    var result = "School: " + document.getElementById('schools').value + "<br/>School Name: " + document.getElementById('sch1').value + "<br/>Location: " + document.getElementById('schloc1').value + "<br/>Year: " + document.getElementById('schoolyear').value + "<br/>Branch: " + document.getElementById('branch1').value; 
                document.getElementById('result').innerHTML = result;
    

    To this, so it adds the new information to the old information:

    var result = document.getElementById('result').innerHTML + "<br/>School: " + document.getElementById('schools').value + "<br/>School Name: " + document.getElementById('sch1').value + "<br/>Location: " + document.getElementById('schloc1').value + "<br/>Year: " + document.getElementById('schoolyear').value + "<br/>Branch: " + document.getElementById('branch1').value; 
                document.getElementById('result').innerHTML = result;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my application i have an form where user enter their username first .
I have put a form on a web page where the user can send
Currently on my application I have a form where I ask the user to
In my web application i have registration form, when user register i want to
I have WPF Application where I have One main form and other user controls
In my application I have a feedback form. The user has to first login
I have an C# form application that use an access database. This application works
I have this application (Windows form application written in Visual C++) from a colleague
I have simple web application (asp.net - ajax) I have a web form which
I'm trying to create a form where a user can type in their email

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.