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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:47:42+00:00 2026-05-24T15:47:42+00:00

I have a list of custom objects that I use as the commandName object

  • 0

I have a list of custom objects that I use as the commandName object in my form, and usually each object contains a String label, String type (INTEGER or BOOLEAN), and a value. For the INTEGER types, the form displays the <form:input and binds just fine. However, with BOOLEAN types, I’d like to be able to use the values strings of ‘true’ and ‘false’ and bind them to a checkbox. This would be easy is they were Boolean types, but they are Strings, and the normal <form:checkbox code, isn’t working. I tried using hidden too, but it isn’t binding correctly. Is there an easy way to do this? When I submit the form again, the checkbox values need to be a string again, i.e. (checked=”true”, unchecked=”false”).

  • 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-24T15:47:43+00:00Added an answer on May 24, 2026 at 3:47 pm

    Checkboxes don’t really have multiple values – either it has the value, indicating it was checked, or it doesn’t. In your case, I would bind the value you want to pass back and forth to a hidden form field, and use client-side JavaScript to set the value of the hidden form field based on whether the user clicks the checkbox or not. Additionally, on page load, Spring will set the value of the bound hidden field, and at that point you can use JavaScript to check the checkbox, or not, based on the bound value in the hidden field.

    Spring Form:

    <form:hidden path="mypassedfield" />
    

    jQuery:

    if($(".mycheckbox").prop("checked", true)){
       $(".mypassedfield").val($(".mycheckbox").val());
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a model that contains an IEnumerable of a list of custom objects.
I have a custom data structure that is pretty much a list of string
I have a list of custom objects List and I would like to update
I have a list of custom objects. These objects have 2 datetime properties on
I have defined a custom list template type for SharePoint . I install it
I have a list within Sharepoint, using a custom new form I have added
I have a number of custom objects of type X. X has a number
I have an ASP.NET web app that places several string data into an object
I have custom Question objects which I render into html form elements. I want
I have a large collection of custom objects that I have retrieved from a

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.