[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

checkbox is too small (up to 50 tables)

Posted on 2012-08-30
4
Medium Priority
?
719 Views
Last Modified: 2012-08-31
<form>
<table>
<tr>
<td>
<input type="checkbox">
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>

<table>
<tr>
<td>
<input type="checkbox">
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>

<table>
<tr>
<td>
<input type="checkbox">
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>

</form>

Open in new window



note: there are up to 50 tables using a php foreach loop

tried adding
<label>

want a large area
ideally the each <table></table>
where user clicks and checkbox gets clicked

you can add ids and classes
0
Comment
Question by:rgb192
  • 2
4 Comments
 
LVL 45

Expert Comment

by:Chris Stanyon
ID: 38351961
Checkboxes are checkboxes - you can't resize them!

Tell us what you're after and we might be able to help. Your code doesn't really make any sense.
0
 
LVL 7

Accepted Solution

by:
dimmergeek earned 2000 total points
ID: 38352059
Your request is vague at best, but the following provides for LARGE checkboxes and the ability to track the status of JavaScript elements for each row as needed when an img is clicked and status is changed:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>BIG CHECKS</title>
    <style type="text/css">
        tr
        {
            width:400px;
        }
    </style>
    <script type="text/javascript" language="javascript">
        var checks = new Array();
        for (var x = 0; x < 5; x++) {
            checks[x] = 0;
        }
        
        function swapImg(el)
        {
            if (checks[el] == 0 || checks[el] == undefined) {
                document.getElementById('row' + el).src = "checked.png";
                checks[el] = 1;
            }
            else {
                document.getElementById('row' + el).src = "notChecked.png";
                checks[el] = 0;
            }
            document.getElementById('results').innerHTML = checks[0] + " " + checks[1] + " " + checks[2] + " " + checks[3] + " " + checks[4];
        }
    </script>
</head>
<body>
    <form>
        <table>
            <tr>
                <td>
                    <img id="row0" src="notChecked.png" alt="" onclick="javascript:swapImg(0);" />
                </td>
            </tr>
            <tr>
                <td>
                    <img id="row1" src="notChecked.png" alt="" onclick="javascript:swapImg(1);" />
                </td>
            </tr>
            <tr>
                <td>
                    <img id="row2" src="notChecked.png" alt="" onclick="javascript:swapImg(2);" />
                </td>
            </tr>
            <tr>
                <td>
                    <img id="row3" src="notChecked.png" alt="" onclick="javascript:swapImg(3);" />
                </td>
            </tr>
            <tr>
                <td>
                    <img id="row4" src="notChecked.png" alt="" onclick="javascript:swapImg(4);" />
                </td>
            </tr>
        </table>
    </form>    
    <br /><br /><br />
    <center>
        <p style="border:solid 3px #A9A9A9;padding:5px 5px 5px 5px;width:75px;height:20px;" id="results"></p>
    </center>
    <script type="text/javascript">
        document.getElementById('results').innerHTML = checks[0] + " " + checks[1] + " " + checks[2] + " " + checks[3] + " " + checks[4];
    </script>
</body>
</html>

Open in new window

notChecked.png
Checked.png
0
 

Author Closing Comment

by:rgb192
ID: 38352343
thanks
for large checkbox
0
 
LVL 7

Expert Comment

by:dimmergeek
ID: 38353926
You're very welcome.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month17 days, 18 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question