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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:02:49+00:00 2026-05-30T01:02:49+00:00

I have difficulty to solve this and would ask your help ! I’m trying

  • 0

I have difficulty to solve this and would ask your help !
I’m trying to make a javascript but i had no success
i have inside a form below, two input checkbox, when the user press the submit
i want to verify if the two checkbox is checked, if they are checked i want to
disable the two before sending it to another page,
and if only one of then is checked, i want to do nothing.

<form action="{$GLOBALS.site_url}/search/">
<input type="checkbox" checked = "checked"  name="new[equal]" value="1" /> New <br>
<input type="checkbox" checked = "checked"  name="used[equal]" value="1" /> Used <br>
<input type="submit" class="button" value="[[Find:raw]]" />
</form>

thank you friends

  • 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-30T01:02:51+00:00Added an answer on May 30, 2026 at 1:02 am

    You can try this.

    var new = document.forms[0]["new[equal]"],
        used = document.forms[0]["used[equal]"]
        if(new.checked && used.checked){
            new.disabled = true;
            used.disabled = true;
        }
    

    If you have multiple forms on the page then you should provide a name to the form and use the form name to select the required form.

    Something like this will do.

    document.formName.elementName or document.formName['elementName']

    Update:
    If you want to validate this on submit button click then you can create a JS function with above code and call it on submit button click

    HTML

    <input type="submit" onclick="ValidateForm()" value="Submit" />
    

    JS

    function ValidateForm(){
       var new = document.forms[0]["new[equal]"],
            used = document.forms[0]["used[equal]"]
            if(new.checked && used.checked){
                new.disabled = true;
                used.disabled = true;
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I usually do not have difficulty to read JavaScript code but for this one
I have been trying to tackle this problem , but I am having difficulty
I am told that the configuration below is possible, but have had significant difficulty
I have encounters this abap snippet that I have difficulty to comprehend. call function
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and
I am having a bit of difficulty with this current code I have set
I'm having an interesting but difficult problem with my JavaScript code. Basically, I'm trying
I have a very difficult problem I'm trying to solve: Let's say I have
I have this code (ok, I don't, but something similar :p) var dogs =
I've posted a couple other questions during this process, but I have a better

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.