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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:06:56+00:00 2026-05-27T09:06:56+00:00

I know there’s the possibility, using jQuery, to mix Multiple Selector with Multiple Attribute

  • 0

I know there’s the possibility, using jQuery, to mix Multiple Selector with Multiple Attribute Selector and, indeed, I used it.
For example, this works fine:

$('input[type="checkbox"][name^="selected"]:checked', theForm).length

In my example, “theForm” is a string containing “#form1″ which I use to refer to my form that has the attribute id=”form1”.

Well, that said, the question is: is it possible mixing the above with jQuery filter?
Here is a code example:

var myVar = $('input[name^="modcc_"]', myForm).filter(...)

I tried to use this and I seem not to get elements in myVar
but If I simply remove “myForm” this way

var myVar = $('input[name^="modcc_"]').filter(...)

it works … WHY? Am I doing something wrong? I know for sure that “myForm” variable is correctly “stuffed” (it’s a string containing “#formMod” which coincide to my form’s id attribute) and I am sure the inputs are inside that form and that it’s the only thing with that ID.

Thank for your help!

P.S.
This question comes from one of my previous I made in a comment to the accepted answer to this question that didn’t get answered. I thought it could anyway deserved to be made as a question instead of a simple comment so… here it is! Hope to have an answer to it…

-Edit
as asked, I put here the form HTML code:

<form action="..." method="post" id="formMod" name="formMod">
   <input type="hidden" name="catid" value="412" />
   <td width="8%">412</td>
   <td>myName</td>
   <td width="9%" style="white-space:nowrap; background-color:LightGoldenRodYellow;">
       <input id="modcc_icv" name="modcc_icv" type="text" value="10" maxlength="3" size="4" />.
       <input id="modcc_dcv" name="modcc_dcv" type="text" value="25" maxlength="2" size="3" />%
   </td>
   <td width="18%" class="actions_col" style="background-color:LightGoldenRodYellow;">
       [ <a href="...">Annnulla</a> ] 
       <input type="submit" name="confirmMod" value="Salva" />
   </td>
</form>
  • 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-27T09:06:57+00:00Added an answer on May 27, 2026 at 9:06 am

    The issue is that you’re using invalid markup.

    You can’t have a <form> element as the direct child of a <tr> element.

    Your HTML will be reworked in various ways depending on the browser, and the <td> elements and their content will likely be removed from the form so that the <td>s are the children of the <tr>.

    When I put your markup in Chrome, this is how it is rendered:

    <tr>
          <!-- THE FORM HAS LOST ITS CONTENT -->
       <form action="..." method="post" id="formMod" name="formMod"></form>
    
       <input type="hidden" name="catid" value="412">
       <td width="8%">412</td>
       <td>myName</td>
       <td width="9%" style="white-space:nowrap; background-color:LightGoldenRodYellow;">
           <input id="modcc_icv" name="modcc_icv" type="text" value="10" maxlength="3" size="4">.
           <input id="modcc_dcv" name="modcc_dcv" type="text" value="25" maxlength="2" size="3">%
       </td>
       <td width="18%" class="actions_col" style="background-color:LightGoldenRodYellow;">
           [ <a href="...">Annnulla</a> ] 
           <input type="submit" name="confirmMod" value="Salva">
       </td>
    
    </tr>
    

    Notice that the <form> element is now empty.

    So that’s why you’re able to find the <input> elements doing a document wide search, but not from the context of the form itself.

    So it has nothing to do with the .filter(), but rather with the fact that you’re not selecting any elements in the first place.

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

Sidebar

Related Questions

I know there have been a few threads on this before, but I have
I know there are ways of installing SQL Express from the command line. This
I know there are dozens of questions that ask about this error, but none
I know there are actually a number of questions similar to this one, but
I know there is a question about this subject already but I think it's
I know there are many questions about this but none of them helped my
I know there are questions on here similar to this, but I have not
I know there are several questions named like this, but they don't seem to
I know there are many threads that talk about this problem but I don't
I know there have been quite a few posts on this but none seem

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.