SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Threaded View

  1. #1
    SitePoint Zealot xiaawan's Avatar
    Join Date
    Sep 2007
    Location
    Islamabad, Pakistan
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    displaying selected checkbox within a div

    HI All,
    I have coded an interface that allows user to search based on their selected criteria. When this page is loaded for the first time none of the check boxes selected. Next time when user comes to this page, those check boxes are preselected that he used last time, and the values are coming from cookies. My problem is that if user selected any option that is away down, then he will not be able to see which one selected, Is it possible I can display which one is selected? I have attached an image that describes what I needed. Anything that can be coded in JavaScript HTML to make it possible, for me its almost impossible. Thanks in advance. Here is my sample code.

    Code HTML4Strict:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <title>Div with checkboxes</title>
    <meta name="Author" content="Ilkka Huotari" />
    <style type="text/css">
    #container
    {
    	border:1px solid #7F9DB9;
    	height:100px;
    	width:200px;
    	overflow:auto;
    	margin:auto;
    }
    div label
    {
    	width:180px;
    	float:left;
    	font-family:Verdana, Arial, Helvetica, sans-serif;
    	font-size:12px;
    	padding:1px;
    	padding-right:0;
    	overflow:hidden;
    }
    div input
    {
    	padding:0;
    	padding-top:5px;
    }
    </style>
    </head>
    <body>
    <div id="container">
    <label for="test1"><input type="checkbox" id="test1" name="test1" />Test 1</label>
    <label for="test2"><input type="checkbox" id="test2" name="test2" />Test 2</label>
    <label for="test3"><input type="checkbox" id="test3" name="test3" />Test 3</label>
    <label for="test4"><input type="checkbox" id="test4" name="test4" />Test 4</label>
    <label for="test5"><input type="checkbox" id="test5" name="test5" />Test 5</label>
    <label for="test6"><input type="checkbox" id="test6" name="test6" />Test 6</label>
    <label for="test7"><input type="checkbox" id="test7" name="test7" />Test 7</label>
    <label for="test8"><input type="checkbox" id="test8" name="test8" />Test 8</label>
    <label for="test9"><input type="checkbox" id="test9" name="test9" />Test 9</label>
    <label for="test10"><input type="checkbox" id="test10" name="test10" />Test 10</label>
    </div>
    </body>
    </html>
    Attached Images Attached Images
    Zia Awan


Bookmarks

Posting Permissions

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