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

  • Home
  • SEARCH
  • 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 8436503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:11:42+00:00 2026-06-10T07:11:42+00:00

In one page I have two form for search: <form class=search-panel method=post action= onsubmit=return

  • 0

In one page I have two form for search:

<form class="search-panel" method="post" action="" onsubmit="return searchRedirect(this)">
        <input type="test" name="searchFor" />
        <div class="additional-search-button"></div>
        <div id="additional-search-box">
            <div class="as-cont">
                Books<input type="radio" name="category" value="Books" checked="1" /><br/>
                School<input type="radio" name="category" value="School" /><br/>
                Music<input type="radio" name="category" value="Music" />
            </div>
        </div>
       <input type="submit" name="search" />
    </form>

<form class="search-panel" method="post" action="" onsubmit="return searchRedirect(this)">
            <input type="test" name="searchFor" />
            Games<input type="radio" name="category" value="Games" checked="1" />
            <input type="submit" name="search" />
        </form>

My problem is that if I click search for Games in searchRedirect always alert Books, School or Music if they checked:

That is my javascript function:

function searchRedirect(form) {
    alert($(form['category']+':checked').val());

    if($(form['category']+':checked').val() == 'Форум')
        window.location.href = '/forum/search.php?keywords='+form['searchFor'].value;
    else {
        window.location.href = '/Search/'+$(form['category']+':checked').val()+'/'+form['searchFor'].value;
    }

    return false;
}

I need if I click to search games – search only for games, if click to search books,school or music – searching only for them. But now search form for games always use first form checked buttons.

  • 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-10T07:11:43+00:00Added an answer on June 10, 2026 at 7:11 am

    form['category'] will give you a NodeList of all form elements whose name is category, thus you can’t use it as a selector by concatenating it with :checked. It’d be the equivalent of $("[object NodeList]:checked").

    Since you are already using jQuery, you can use the following instead:

    alert($(form).find("input[name='category']:checked").val());
    

    That is, within the context of form, find every input element with name category that is checked, and get its value.

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

Sidebar

Related Questions

I have two forms on one page: a results form and a search form.
I have two controls on a page, one is a search entry and submission
I have two carousels on one page but unfortunately they copy each other. http://jsfiddle.net/seanjacob/tB6y5/
I have two forms on one page and want to have the input boxes
I have two related tables in my database: Page and Tag. One Page can
I have multiple Facebook like boxes in one page. Suppose, I have two dives
I have two forms, and so two different submit buttons, for one page (page
I have two div in my website page one beside the other(one left and
I have two pages that inherit from one master page, First.aspx or second.aspx. Navigation
I have two tables, one contains the page/heading number and the heading text, the

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.