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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:51:49+00:00 2026-06-07T05:51:49+00:00

I have a form, in it where is an icon. Currently, to select between

  • 0

I have a form, in it where is an icon.

Currently, to select between true and false. There is a combo box underneath the icon, however, what I need to do is to be able to switch states depending on the icon in the combo box itself. If the boolean in the database is false, X will appear, BUT if someone clicks on the X the boolean in the database is then set to true, with the icon changing into a tick.

How can I achieve this? I have looked into jquery but it isnt quite what I am looking for.

Cheers.

  • 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-07T05:51:50+00:00Added an answer on June 7, 2026 at 5:51 am

    It is what you are looking for, you just don’t know how to take advantage of it.

    First you need to setup your form correctly, you can inspire yourself from this:

    <form>
        <select name="myselectcheckbox" id="myselectcheckbox">
            <option value="X"<?php if($data['myselectcheckbox'] == 'X'){ echo ' selected="selected"'; ?>>Yes</option>
            <option value=""<?php if($data['myselectcheckbox'] == ''){ echo ' selected="selected"'; ?>>No</option>
        </select>
    </form>
    

    That should do it for the form element, the code for the jQuery will be this:

    <script>
    $(function(){
        $('#myselectcheckbox').hide().append('<a href="#" id="myselectedcheckbox_toggler"><img src="checkbox.gif"></a>');
        $('#myselectedcheckbox_toggler').click(function(){
            if($('#myselectcheckbox').val() == 'X'){
                $('#myselectcheckbox').val('');
                $('#myselectedcheckbox_toggler img').attr('src', 'checkbox.gif');
            }else{
                $('#myselectcheckbox').val('X');
                $('#myselectedcheckbox_toggler img').attr('src', 'checkbox-checked.gif');
            }
        });
    });
    </script>
    

    That sounds about right, test it out and try to do the rest by yourself. The code is pretty self explanatory, i couldn’t help you more than that.

    Good luck

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

Sidebar

Related Questions

I have given 2 option(upload icon/select icon) in form, but when i am checking
I have an application with multiple forms, each form has the same icon, so
Currently I have a form class Project extends AbstractType { public function buildForm(FormBuilder $builder,
I have form @using (Html.BeginForm(Create, StoreManager)) { @Html.ValidationSummary(true) //etc.. } User uploads images to
I have this little form that has a button loading a little icon onto
I have a System.Windows.Forms.Form and want to change the Form.Icon at runtime to display
I have form where are 2 input fields and then i have dynamic dataTables
I have form with 1 button. when you click on the button 3 others
I have form with few buttons and I want to know what button is
I have form where user submits field. Field can have letters, numbers, and punctuation.

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.