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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:40:39+00:00 2026-06-08T18:40:39+00:00

I have a web form that has a check box in it. The form

  • 0

I have a web form that has a check box in it. The form is created dynamically so there could be multiple checkboxes on this form. I need to know whether it is checked or not. The problem is an unchecked checkbox POSTs nothing at all.

I know this has been asked before but the solution is always to provide a hidden field with a the value. The problem I have is I need to know whether it was checked out not, not necessarily the value. Is there a way to make this happen? I was thinking I would need to use some javascript but not really sure how to go about 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-08T18:40:40+00:00Added an answer on June 8, 2026 at 6:40 pm

    You could create a hidden input with the same name but the value "off". Make sure it is located before the checkbox in the document. Example:

    <input type="hidden" name="something" value="off" />
    <input type="checkbox" name="something" />
    

    This will submit the following:

    // if the box is unchecked:
    something=off
    // if the box is checked:
    something=off&something=on
    

    Since duplicate names results in overwriting the previous value (except in the case of arrays), you will always get $_POST['something'] that is either "on" (checked) or "off" (unchecked).

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

Sidebar

Related Questions

I have a web form with about 15 checkboxes that users may check 0
I have a web app that has a big and complex form (fields, checks,
I have a web form that has 2 radio buttons, depending on which one
I currently have a web form aspx page that calls RegisterClientScriptBlock. This sends down
You have a web page with a form that has an input field of
I have an ASP.NET web form application that on the server side I need
I have a web form that inserts a row into an SQL Server 2008
I have a web form that collects information and submits it to a cgi
I have a web form that manipulates records in a MySQL database. I have
I have a web form that uses if statements to create a string of

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.