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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:54:10+00:00 2026-05-31T01:54:10+00:00

Looking for a way to call Server side method (Java) upon dropdown selection-change and

  • 0

Looking for a way to call Server side method (Java) upon dropdown selection-change and based on the server output (TRUE OR FALSE), enable or disable few checkboxes. Would highly appreciate if anyone can provide recommendations around the same.

  • 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-31T01:54:11+00:00Added an answer on May 31, 2026 at 1:54 am

    I’ve coded a quick example to show you how this would be done. First you will need to set up your java app to allow ajax calls. The java app will need to take in as input a single post variable name selected which is the value of the selected option in the dropdown menu. The java app will then need to return a json string formatted similar too:

    {
        "disabled":[
            "1",
            "3",
            "5"
        ]
    }
    

    The 1, 3, and 5 represent the ids of the checkboxes you would like to be disabled. These can be any ids of any of the checkboxes. If it isn’t in this array, it will be set to enabled by default.

    HTML:

    <select id="choiceSelector">
        <option value="1">Something 1</option>
        <option value="2">Something 2</option>
    </select>
    
    <br/><br/>
    <div id="changingCheckboxes">
        <input type="checkbox" name="" id="1"><br/>
        <input type="checkbox" name="" id="2"><br/>
        <input type="checkbox" name="" id="3"><br/>
        <input type="checkbox" name="" id="4"><br/>
        <input type="checkbox" name="" id="5"><br/>
        <input type="checkbox" name="" id="6">
    </div>​
    

    Javascript/jquery

    function UpdateCheckBoxStatus ()
    {
        var CurrentChoice = $('#choiceSelector').val();
    
        $.ajax({
            url: "####YOUR JAVA APP URL####",
            data: { "selected": CurrentChoice },
            type: "post",
            dataType: "json",
    
            success: function (data)
            {
                SetCheckbox($('#changingCheckboxes').children("input:[type='checkbox']"), true);
                $.each(data.disabled, function ()
                {
                   SetCheckbox($('#changingCheckboxes #' + this), false);
                });
            }
        });
    
    }
    
    /// Sets the checkbox to enabled or disabled
    /// @param th Jquery reference of one or more checkboxes
    /// @param usable True/False if the checkbox is enabled/disabled
    function SetCheckbox (th, usable)
    {
        if (usable)
            th.removeAttr("disabled");
        else if (!usable)
            th.attr("disabled", true);
    }
    
    
    $(function ()
    {
        $('#choiceSelector').change(UpdateCheckBoxStatus);
        UpdateCheckBoxStatus(); //run for page load
    });
    

    Also, here is the jsfiddle of it: http://jsfiddle.net/bpstw/1/

    Hope that helps.

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

Sidebar

Related Questions

I was looking for a way to call the edit method directly. - (void)tableView:(UITableView
What I am looking for is a way to call a method after another
I'm looking for an easy way to call a bean's method that will take
We're looking for a way to log any call to stored procedures in Oracle,
I looking for a way to programmatically start a VOIP call using the SIP
I'm looking a way to build conditional assignments in bash: In Java it looks
I'm looking for a way to implement RPC between Java and C. What are
I'm looking for another way of doing the following: function call_any_function(func, parameters){ // func
I'm looking for way to PHP to detect if a script was run from
I'm looking a way to enable IP logging with log4net in ASP.NET. I found

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.