www.webdeveloper.com
Results 1 to 3 of 3

Thread: Check box

  1. #1
    Join Date
    Nov 2002
    Posts
    2

    Question Check box

    Hi,
    I have a checkbox in my form and this is the part of the code:

    <INPUT type="checkbox" name="Same" value="Yes" onclick="DoCopy();">Same as Above


    and this at the top of the page:

    <script language="JavaScript">
    function DoCopy()
    {
    if (document.Form1.Same.checked=true)
    {
    document.Form1.ShippingAddress1.value=document.Form1.Address1.value;
    }
    }

    </script>

    The problem is: when I select the check box, it takes it and does the copy function fine, but I cannot deselect the check box afterwards. Could someone please tell me where the problem is?
    Thanks in advance.

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473

    Re: Check box

    Originally posted by shida
    if (document.Form1.Same.checked=true)

    Could someone please tell me where the problem is?
    Thanks in advance.
    Do you know the difference between "is equal to" (==) and "is assigned to" (=), or did you make a typo?

  3. #3
    Join Date
    Nov 2002
    Posts
    4,473
    Thanks!

    This layout seems slightly livelier somehow.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles