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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:53:10+00:00 2026-05-27T07:53:10+00:00

hi guys i am new to js and html.I need a o/p as when

  • 0

hi guys i am new to js and html.I need a o/p as when click the button tat should show the all contents entered in form…
My code for giving alert of all entered data in single
how can I add values of form textbox using string ,for loop all should be only in javascript…or else give your own code with the conditions i said….

<html>
<head>
<title>elements in a form</title>
<script type="text/javascript">
function processFormData() 
{
var len= document.getElementsByTagName('name');

var str1=null;
for(i=0;i<=len;i++)
{
var str=(subscribe.name[i].value);

str=str1+str; 
 }
  alert(str);

}

</script>
</head>
<body>

<form name ="subscribe" > 
    <p><label for="name">Your Name: </label><input type="text" name="name" id="txt_name" value="name"></p>
    <p><label for="email">Your Email: </label><input type="text" name="email" id="txt_email" value="mail"></p>
<input type="button" value="submit" onclick="processFormData()">


</form>
</body>
</html>
  • 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-27T07:53:11+00:00Added an answer on May 27, 2026 at 7:53 am

    Try that for a start

    var len= document.getElementsByTagName('input').length; 
    // add that you want the number of element
    // Change 'name' for 'input' when using 'name' you are looking for <name in the HTML
    // if you want the element with the name ABC use getElementsByName()
    
    var str1='';
    for(i=0;i<=len;i++)
    {
        var str=(subscribe[i].value);
    
        str1=str1+str; 
     }
      alert(str1);
    

    jsFiddle example (in jQuery for the calling of the function) : http://jsfiddle.net/DavidLaberge/HPuhg/1/

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

Sidebar

Related Questions

I need to click in a Close img, and remove all the column where
Ok guys.. I have a HTML i need to parse into a php script
Hi guys i have problem i need show image in EditText use : ImageGetter.
So I've condensed my problem into a snippet of HTML code for you guys
Hey guys. I have this function: i need split headers and html. string simpleGET(string
Hi Guys new to this site but a big fan. Right the problem. It's
Guys I'm new to RoR and MVC. I've a model which deals with loan
Hi guys I am new to android...I want to display a dynamic list of
Hey guys I'm new to C# and I'm a little confused on the fields
Guys i am very new to jQuery. I have started using the auto complete

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.