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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:14:30+00:00 2026-05-27T14:14:30+00:00

I have a form and within it is this: <fieldset class=billing-address> <legend>Billing Address</legend> <ol>

  • 0

I have a form and within it is this:

<fieldset class="billing-address">
    <legend>Billing Address</legend>
  <ol>
        <li class="text combi"><label for="bill-address1">Address:</label> <input size="20" value="" name="basket_order:default:bill_address1" id="bill-address1"></li>
        <li class="text"><label for="bill-address2">Address:</label> <input size="20" value="" name="basket_order:default:bill_address2" id="bill-address2"></li>
        <li class="text"><label for="bill-address3">Town/City:</label> <input size="20" value="" name="basket_order:default:bill_address3" id="bill-address3"></li>
        <li class="text"><label for="bill-address4">Region:</label> <input size="20" value="" name="basket_order:default:bill_address4" id="bill-address4"></li>
        <li class="text"><label for="bill-post-code">Post code:</label> <input size="10" value="" name="basket_order:default:bill_postcode" id="bill-post-code"></li>
    </ol>
</fieldset>

For reasons too biring to go into here, I cannot get at the HTML directly and need to do things via javascript. So, I add a checkbox and label above using the following:

$('.billing-address ol').before('<input type="checkbox" id="billing-add-different" /><label for="billing-add-different">My billing address is the same as my delivery address</label>');

    $('#billing-add-different').prop('checked',true).toggle(
        function(){
          $('.billing-address ol input, .billing-address ol select').css('background','#CCC').attr('disabled','disabled');
        },
        function(){
          $('.billing-address ol input, .billing-address ol select').css('background','#FFF').removeAttr('disabled');
        }
      );

This toggles the ‘disabled’ attribute and background colour depending on whether it’s ticked or not.

However, though the function is firing, the checkbox is still visually checked.

I’ve made a jsfiddle to illustrate at http://jsfiddle.net/EFQuh/. The error occurs in Firefox 8.0, not sure about others.

  • 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-27T14:14:30+00:00Added an answer on May 27, 2026 at 2:14 pm

    I don’t know what is the problem (probably the toggle function), but you can simplify your code to:

    $('#billing-add-different').prop('checked',true).change(function(){
        $('.billing-address ol input, .billing-address ol select')
            .css('background-color', this.checked ? '#CCC' : '#FFF')
            .prop('disabled',this.checked);
    
    }).change();
    

    DEMO

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

Sidebar

Related Questions

I am stuck at a small problem. I have this button within a form
I have a complex input form within a PHP based web application. To structure
I have a function definition of the following form (within a large code): class
I have just a basic html form within index.php which contains two text fields:
I have a basic form with a search input and a submit button within.
hopefully will explain this right! Ok, Basically I have a form within my sitecore
So the code that I have so far is: <fieldset id=LinkList> <input type=text id=addLinks
I have a group of fieldset elements within a form. I need to make
I have a form within a draggable() div. The form simply looks like this:
I have a winform application that goes with name myForm . Within this form

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.