HTML Help
HTML Help Central . com

» Online Users: 45

0 members and 45 guests
No Members online
Most users ever online was 695, 02-16-2011 at 08:01 AM.

» Site Navigation

 > FAQ

» Domains For Sale

Results 1 to 6 of 6
  1. #1
    wndola Guest

    using a link to select a checkbox (need help)

    does anyone have any hints or know of a script I can use to select or deselect a checkboz by clicking on a text link

  2. #2
    Join Date
    Sep 2004
    Location
    kent. england
    Posts
    139
    Im not sure if this is the proper way or anything but whilst messing with YABBA's code for disabling form objects i got it to select a check box from a text link. its YABBA's code but slightly adjusted. As i say im sure its not how it should be done but this might help you for a while untill someone who understands the code can help better. good luck
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta content="Keywords go here" name="keywords" />
    <meta content="Description goes here" name="description" />
    <meta content="This website is coded and maintained by *****" name="author" />
    <meta content="copyright goes here" name="copyright" />
    <meta http-equiv="Content-Style-Type" content="text/css2" />
    <title>Demo</title>
    <link href="style.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript">
    function FnCheck(yCheck,yAffect){
    document.getElementById(yAffect).checked=yCheck;
    }
    function FnunCheck(yCheck,yAffect){
    document.getElementById(yAffect).checked=false;
    }
    </script>
    </head>
    <body>
    <div>
    <a href="#" onclick="FnCheck(this,'ycheckbox')">Check</a><br>
    <a href="#" onclick="FnunCheck(this,'ycheckbox')">UnCheck</a><br>
    <input type="checkbox" id="ycheckbox" /> This will be Selected<br /><br />
    
    </div>
    </body>
    </html>

  3. #3
    wndola Guest
    very very cool ....except is doesn't seem to work on the mac.... I am thinking it is a syntax issue...any ideas?

  4. #4
    Join Date
    Sep 2004
    Location
    kent. england
    Posts
    139
    nope i have no idea, i dont understand it. i just happened to stumble accross it. ask YABBA he might know.

  5. #5
    Join Date
    Aug 2003
    Posts
    1,464
    Try this and see if it works on the mac :-
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta content="Keywords go here" name="keywords" />
    <meta content="Description goes here" name="description" />
    <meta content="This website is coded and maintained by *****" name="author" />
    <meta content="copyright goes here" name="copyright" />
    <meta http-equiv="Content-Style-Type" content="text/css2" />
    <title>Demo</title>
    <link href="style.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript">
    function FnCheck(yCheck){
    document.getElementById(yCheck).checked=!document.getElementById(yCheck).checked;
    }
    </script>
    </head>
    <body>
    <div>
    <input type="checkbox" id="myCheck" /><br />
    <span onclick="FnCheck('myCheck')">Click here to toggle the checkbox</span>
    </div>
    </body>
    </html>
    I may have opened the door, but you entered of your own free will
    Blog - Spam Trap -Blogrums

  6. #6
    Join Date
    Jul 2008
    Posts
    1

    Thank you all

    This is exactly what i am looking for ...

Similar Threads

  1. checkbox into sql
    By Chris in forum PHP
    Replies: 11
    Last Post: 02-05-2009, 02:00 AM
  2. Checkbox code
    By cadmiumred in forum PHP
    Replies: 1
    Last Post: 08-29-2008, 02:39 AM
  3. Checkbox verify
    By cadmiumred in forum HTML / XHTML / XML
    Replies: 1
    Last Post: 08-29-2008, 02:38 AM
  4. checkbox = submit
    By nasht in forum Javascript / AJAX / VBScript
    Replies: 3
    Last Post: 06-10-2004, 07:07 AM
  5. Checkbox values
    By Art Guy in forum Javascript / AJAX / VBScript
    Replies: 5
    Last Post: 02-28-2003, 04:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.1.1