replacing checkboxes with images - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: replacing checkboxes with images (/showthread.php?tid=49672) |
replacing checkboxes with images - El Forum - 02-28-2012 [eluser]bibiki[/eluser] Hey there, could someone guide me on how to replace checkboxes with images. I want users to be able to make their selections based on images they see instead of checking as <input type='checkbox'/> makes possible. I know I need to use javascript, but do I need to pass that javascript to form_checkbox(), or do I do that referencing some javascript file on top of my html/php file? thank you in advance. replacing checkboxes with images - El Forum - 02-28-2012 [eluser]Mauricio de Abreu Antunes[/eluser] Ok, do you need to click the image for this? If not: Code: function checkBoxByImage(checkBoxId) { In your PHP loop for print images/checkbox, print the id in your image tag. Code: <img src="myassisburning.jpg" /> //Call javascript function here with id below EDIT: sorry, editor blocked my "javascript call" replacing checkboxes with images - El Forum - 02-28-2012 [eluser]CroNiX[/eluser] http://filamentgroup.com/lab/accessible_custom_designed_checkbox_radio_button_inputs_styled_css_jquery/ replacing checkboxes with images - El Forum - 02-28-2012 [eluser]bibiki[/eluser] Hey friends, thank you for your prompt replies. This seems to be making sense. thanks again. replacing checkboxes with images - El Forum - 02-28-2012 [eluser]Mauricio de Abreu Antunes[/eluser] Lemme know if my code example worked fine. %-P replacing checkboxes with images - El Forum - 03-06-2012 [eluser]bibiki[/eluser] Hey Mauricio, I just wanted to let you know that I still do not have anything working as far as this issue goes. I thought I'd leave this for when I get to making my app pretty. Besides, I am not sure using checkboxes is the right way to do what I am trying to do. The number of options to select will vary over time. As a result, I'd better use multiselect. However, CI's multiselect seems a little hard to use. I can not seem to make selection of more than two options possible. When I pass on to code further the selections, what I get is one option select only. Anyways, just wanted to let you know how everything went as you asked to be informed. Kind regards. replacing checkboxes with images - El Forum - 03-06-2012 [eluser]Mauricio de Abreu Antunes[/eluser] Everything is easy with CI. |