Get best price on Prepaid Samsung Galaxy A01 | ||||||||||||
|
||||||||||||
|
JavaScript: Smarter CheckboxesAuthor: Marcus Kazmierczak, marcus@mkaz.com This script also fixes a problem identified in a usability concept that I cannot remember the name of. It boils down to the fact that when you ask a user to click a little, tiny region of the screen, the user is more likely to miss the target and either select the wrong item, or select nothing at all. This script will reduce these common and unnecessary errors by providing a bigger target. It will also make it easier on users. We can all use a break sometime. Effort spent clicking the exact right spot is not necessary. All forms that use checkboxes (and radio buttons) should try to duplicate the functionality of the common user interfaces because that is what the user expects. Heres an example: JavaScript Code<script language="JavaScript"> function cboxclick(item) { // check if already checked and toggle if (document.f.cb[item].checked) { document.f.cb[item].checked=false; } else { document.f.cb[item].checked=true; } } </script> HTML Code<form name="f"> <p><b>Select which items you want:</b><br /> <blockquote> <span onClick="cboxclick(0)"><input type="checkbox" name="cb" value="item1">Item 1</span><br /> <span onClick="cboxclick(1)"><input type="checkbox" name="cb" value="item2">Item 2</span><br /> <span onClick="cboxclick(2)"><input type="checkbox" name="cb" value="item3">Item 3</span><br /> <span onClick="cboxclick(3)"><input type="checkbox" name="cb" value="item4">Item 4</span><br /> </blockquote></form>
|
privacy policy || © 1997-2016. astonishinc.com All Rights Reserved. |