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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:51:58+00:00 2026-06-12T07:51:58+00:00

<form method=’post’> <input type=’text’ name=’A’> <input type=’text’ name=’B’ readonly> <input type=’text’ name=’C’ class=’CCC’> <select

  • 0
<form method='post'>
<input type='text' name='A'>
<input type='text' name='B' readonly>
<input type='text' name='C' class='CCC'>
<select name='D'><option value=''>Select</option></select>
<input type='text' name='E' class='first'>
<input type='text' name='F' class='first'>
<button type='submit' name='BTN'>click</button>
</form>

how to use jquery to find above different elements? so far i only know .prev() but sometime it return back to me NULL/object when i use a lot .prev() to climb up.

any good way to learn?!

Sorry, let me put more detail on what i wish to learn here.

1). my way to get value from A, when click on button
$(this).prev().prev().prev().prev().prev().prev().val()
should have more better way right!

2). how to find previous element which is readonly?

3). how to find or get value from previous element whihc have class ‘CCC’?

4). how to find or get different value which have same class of ‘first’? i know there is something like :first or second but i keep getting error code, when i write something like $(“input[class=’first’]:first”).val() / $(“input[class=’first’]:second”).val()

  • 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-12T07:51:58+00:00Added an answer on June 12, 2026 at 7:51 am

    You can go to the form element, and find any field in it, for example:

    $(function(){
    
      $('button').click(function(){
    
        var c = $(this).closest('form').find('[name=C]');
        alert(c.val());
    
      });
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple form method... <form method=POST action=j_security_check> <table> <tr> <td>Name:</td> <td><input type=text
form html: <form action='/register/' method = 'post'>{% csrf_token %} ... <label>Avatar: </label><input type='file' name='avatar'
<form method = post action = <?php echo $_SERVER['PHP_SELF']; ?> /> Username:<input type =
Getting variable from form: <form method = 'POST' action = ''> <input type =
I do have a search form. <form method=get id=searchform action=<?php bloginfo('siteurl');?>> <div class=search_bx1><input type=text
Consider the following Mechanize form object #<Mechanize::Form {name f1} {method POST} {action f.php} {fields
<?php $var = arbitrary; echo <<<_END <form method = post action = feed.php> <input
I have a form that looks something like this <form action=# class=ajax_form method=post id=comment_form
I have a html form with the data by this post method 'form id='form1'
I am working with the following HTML form: <form method = 'POST' action =

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.