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

The Archive Base Latest Questions

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

After submitting a search query to a php file I try to go back

  • 0

After submitting a search query to a php file I try to go back to the previous page in order to test if all is well e.g.

> search.php [goto] > results.php [backto] > search.php

I have this bit of JQuery code which checks if a checkbox is checked upon landing on the search.php file

$(document).ready(function(){       
   if($("input[name=filterSite]").not(':checked')){
       alert("not checked");
   }
});

It always returns not checked even though the html markup is always set to the following

<input name="filterSite" type="checkbox"   id="filterSite" checked="checked" />

What could be causing this problem? and how do I fix it?

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

    Most jQuery methods return objects, not boolean values (so that you can chain methods to get to the desired result). The return value of .not() will always be an object (which will evaluate to true in the above condition).

    What you want is one of these two:

    $(document).ready(function(){       
       if($("input[name=filterSite]").not(':checked').size()){
           alert("not checked");
       }
    });
    

    OR:

    $(document).ready(function(){       
       if($("input[name=filterSite]").is(':checked') == false){
           alert("not checked");
       }
    });
    

    .size() will return the number of elements which are currently part of the selector

    .is() returns boolean, evaluating whether or not the elements in the selector match the given condition

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

Sidebar

Related Questions

My main page is index.php . I am using CAPTCHA in that, after submitting
I have an updatepanel which after clicking one button is submitting the page. The
I'm trying to use urlencode to convert the string: <a href=<?php print 'search.php?query='.quote_replace(addmarks($search_results['did_you_mean'])).'&search=1'?>> Actually,
I am having private Timestamp timeStamp; in my class.(action file) after submitting form the
How can I test that a user is logged in after submitting the registration
I have implemented a search feature of my application. After submitting a search term,
When I loaded a web page after submitting something into a javascript-type form I
After submitting, redirecting to the same jsp page select box value should be previously
When a user registers, if there is an error, after submitting the page refreshes
The error occured after submitting Create my Profile Routing Error No route matches [POST]

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.