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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:22:31+00:00 2026-05-25T06:22:31+00:00

suppose i have form and it has many form fields. how can i iterate

  • 0

suppose i have form and it has many form fields. how can i iterate with in all form fields and check the input type and collect the value

my form fields are

<form id="form1" runat="server">
<div>
    <fieldset>
        <ol>
            <li>
                <label class="left">
                    First Name
                </label>
                <input type="text" id="FirstName" runat="server" /></li>
            <li>
                <label class="left">
                    Last Name
                </label>
                <input type="text" id="LastName" runat="server" /></li>
            <li>
                <label class="left">
                    Email
                </label>
                <input type="text" id="Email" runat="server" /></li>
            <li>
                <label class="left">
                    Phone
                </label>
                <input type="text" id="Phone" runat="server" /></li>
            <li>
                <label class="left">
                    Contact Method
                </label>
                <span class="checkBoxGroup">
                    <input type="checkbox" id="ReqEmail" runat="server" /><label>Email</label>
                    <input type="checkbox" id="ReqMail" runat="server" /><label>Mail</label>
                    <input type="checkbox" id="ReqPhone" runat="server" /><label>Phone</label>
                    <input type="checkbox" id="ReqNoContact" runat="server" /><label>No Contact</label>
                </span></li>
            <li>
                <label class="left">
                    New Letter Type
                </label>
                <span class="myGroupRandom" >
                    <input type="checkbox" id="Checkbox1" runat="server" /><label>Company News</label>
                    <input type="checkbox" id="Checkbox2" runat="server" /><label>Press Releases</label>
                    <input type="checkbox" id="Checkbox3" runat="server" /><label>Deals</label>
                    <input type="checkbox" id="Checkbox4" runat="server" /><label>Employement</label>
                </span></li>
            <li>
                <input type="submit" id="Submit" value="Submit" /></li>
        </ol>
    </fieldset>
</div>
</form>

please guide thanks

  • 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-25T06:22:32+00:00Added an answer on May 25, 2026 at 6:22 am

    You could use each:

    $.each($("input"), function(index, item) {
        var type = $(this).attr("type");
        var val = $(this).val();
        //do your checking...
        if (type == "text") {
            //and so on...
        }
    });
    

    Note that I use $(this) to access the item, rather than the item parameter argument – using item might not cause an issue when working with only input elements, but I have had trouble in the past when accessing properties and methods of an element using the item, so generally resort to $(this).

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

Sidebar

Related Questions

I have a form that has fields with the following name <input type=text name=value[]>
Suppose I have the following HTML: <form id=myform> <input type='checkbox' name='foo[]'/> Check 1<br/> <input
so suppose I have 3 forms <form name=form1> <input name=input></input> <submit></submit> </form> <form name=form2>
HI, suppose i have given input numbers like this 1,2,3,4,5,6,7,8,9,0 i should form it
In SQL server 2008: Suppose I have two tables. Table1 has 3 fields: Name,
Suppose I have two forms: Form1 and Form2. Form2 has a text control named
I have a form on the page. It has too many things like checkboxes
I have a model named UserPrice which has a form where you can create
Suppose you're building an HTML form and you want to have 2 or more
Suppose I have: Toby Tiny Tory Tily Is there an algorithm that can easily

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.