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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:24:26+00:00 2026-05-23T04:24:26+00:00

Ok thanks to the guys on here we have sorted functions for checkbox click,

  • 0

Ok thanks to the guys on here we have sorted functions for checkbox click, and are now using unobtrusive js.

What I want to achieve is..

We have a form, and on submit with checkbox unclicked, the form submits as it would normally…

But.. I have added an option to click checkbox, and display hidden content .. which I want to be part of same form, but with additional values etc..

Essentially…

if checkbox is unchecked, show standard submit button.

if checkbox is clicked, hide standard button and toggle additional form elements and new submit button.

The issue I am facing is :

  1. passing a numeric value onclick from the checkbox, so need set to 1 or 0
    0 being standard do nothing
    1 hiding submit button, and toggling hidden additional form fields.

I can get the toggle working, but onclick of the checkbox it doesnt do anything.

I am also baffled as to hide the submit button ( normally displayed ) if checkbox is clicked.

script for hidden element:

$('.styledCheckbox').change(function() {
    if ($(this).val() != "0") {
    $('.extraForm').show('fast');
    }else if ($(this).val() == "0") {
    $('.extraForm').hide('fast');
}

});

script for the checkbox:

 $(function(){
  $('.styledCheckbox').click(function(){
    setCheckboxDisplay(this);
  });
});

html for the checkbox:

<input name="include" type="checkbox" id="checkbox"  class="styledCheckbox" />

hidden div

<div class="extraForm" style="display:none;">
                                        <!--extra form elements and submit button here-->
                                    </div>

Oh and would idealy like form to have dynamic action based on event handler, so if standard form submit.. do something, if checkbox selected , form submit … do something else

Also looking to change form action based on CHECKBOX selection ?

so something like …

changeAction(url) {
document.this_form.action = “clicked.php”;
}

< form method=”POST” name=”this_form” action=”unclicked.php”>

  • 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-23T04:24:27+00:00Added an answer on May 23, 2026 at 4:24 am

    I think it is not working because you don’t have a value set for your checkbox. Also, it is better to the jQuery is(":checked") function to check if the checkbox is checked:

    JS:

    $('.styledCheckbox').change(function() {
        if ($(this).is(":checked")) {
            $('.extraForm').show('fast');
        } else {
            $('.extraForm').hide('fast');
        }
    });
    

    HTML:

    <input name="include" type="checkbox" id="checkbox" value="yes" class="styledCheckbox" />
    

    Ad@m

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

Sidebar

Related Questions

Hey guys here is my question. im using JCombobox. if a student have CB
I have got many of my questions solved here, many thanks to you guys.
Guys here's what I want to do... I have 3 columns: category, product and
Thanks to this question (click me!) , I have the Source property of my
I have this link (not a button) that I want to click on ...I
Noob here. I have a super column family sorted by timeuuidtype which has a
I'm fairly bad at javascript, but here's what I want. I have a PHP
I have a little problem here: I want to make a button in my
thanks guys.i managed to complete it.million thanks again specially for DAVID,WM-EDDIE and S.LOTT.also STACKOVERFLOW
Update: Thanks guys, I didn't realize it was very close to zero but not

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.