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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:25:26+00:00 2026-05-13T20:25:26+00:00

My HTML form is something like as follows <form id=form1 name=form1 method=post action=> number:

  • 0

My HTML form is something like as follows

<form id="form1" name="form1" method="post" action="">
number: <input name="formnum" type="text" id="input_1" tabindex="1" size="30" maxlength="30" />
Title:
<select name="title" id="input_2" tabindex="2" >
   <option selected="selected" value=""></option>
   <option  value="Mr." id="option_1 ">Mr.</option>
   <option  value="Mrs." id="option_2">Mrs.</option>
   <option  value="Ms." id="option_3">Ms.</option>
   <option  value="Dr." id="option_4">Dr.</option>
</select>
<label> <input type="radio" name="gender" value="Male" id="input_3" tabindex="3"/>Male </label>
<label> <input type="radio" name="gender" value="Female" id="input_3"/> Female</label>
First Name:
<input name="fname" type="text" id="input_5" tabindex="4" value="" size="30" maxlength="30"  />
Last Name:
<input name="lname" type="text" id="input_6" tabindex="5" value="" size="30" maxlength="30"  /> 
Address:
<input name="address" type="text" id="input_7" tabindex="6" value="" size="30" maxlength="30"  />
<input type="submit" name="Submit" value="Submit" tabindex="16" />
<input type="reset" name="Submit2" value="Reset" tabindex="17" />
</form>

I want to make list of all input elements in a form in the sequence they appear in browser on $(document).ready(). I wrote following statement in jQuery to list out the input elements in a form in the sequence they appear in browser:

var textboxes = $("#form1 :input")
  1. But this statement gives only list of elements having input tag i.e. all text boxes, radio buttons and submit buttons.
  2. It didn’t include the select box, text area, in the given list.

This is my jQuery code:

$(document).ready(function(){

var textboxes = $("#form1 :input"), //gets all the textboxes         
        images = $("img.classforimg");   //gets all the images
    images.hide(); //hide all of them except the first one
alert(textboxes.length);
    textboxes.each(function (i){
                var j = i;
                    $(this).focus(function (){
                images.hide(); //hide all of them except the first one
                                images.eq(0).show();
                images.eq(j).show();
                });
            });

**Here Jquery code for form validation**
**Here Jquery code of Custom validation methods**
});

Questions:

  1. How could I get the the list of all elements in the form in the sequence they appear in browser on $(document).ready() including all input text boxes, group of radio buttons, check boxes, select boxes, textareas and buttons?
  2. The above statement considers radio buttons in above form as individual radio buttons and does not considers them as a group but actually above radio buttons are of same group.
    So how to solve these problem?

Please help me friends!
Thank You!

  • 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-13T20:25:26+00:00Added an answer on May 13, 2026 at 8:25 pm
     $('#form1 input,#form1 select,#form1 textarea')
    

    or

    $('#form1').find('select,input,textarea')
    

    Updated for answer 2:

    $('#form1').find('select,input[type!=radio],textarea,input[type=radio]:checked')
    

    You can find the selected radio input with input[type=radio]:checked, however if no radio option in the group is selected, you will not get any of the options. JQuery should parse this in the same order they are found in the DOM

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

Sidebar

Related Questions

I have a html form <form action=process.php method=post> <input type=checkbox name=name[v1] /> <input type=checkbox
Is something like this possible: <form method=post action=myphp.php name=myname target=another_html/iframe_name>??? I want the php
I have HTML that looks like this: <form id=kinodForm> <input type=text name=element[5] value=krispy kreme
I have some html form like that: ... <input type="text" id="color" name="color" value="" placeholder="Color"
I have a simple html form that is structured something like this: <form name=test
I have a simple html form that looks like the following <form action=search.php method=get>
If I have an HTML form, let’s say... <form id='myform'> <input type='hidden' name='x' value='y'>
I have an html form that looks something like this: <div class=field> <input id=product_name
I have an ASP.NET MVC form laid out something like this: @using (Html.BeginForm(null, null,
I have to build an HTML Form with an Input text field for Hours

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.