ankit.pandeyc012 Posted November 16, 2010 Share Posted November 16, 2010 Hi Friends................ In above code I am using checkbox but I want that it looks like just button but act as a checkbox....... Anyone hvae any idea??????????????? Help me plz...................... Thx in advance................. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/218834-i-need-to-use-checkbox-which-looks-like-button/ Share on other sites More sharing options...
radar Posted November 26, 2010 Share Posted November 26, 2010 you could create and up-state and a down-state for the same image... then run it through javascript ie: onclick="checkIt(); return false" <-- nearly always return false function checkIt() { if(document.getElementByID('checkbox').value == 'on') { document.getElementByID('checkbox').value = 'off'; document.getElementByID('image').style.class = 'image_up'; } else { document.getElementByID('checkbox').value = 'on'; document.getElementByID('image'].style.class = 'image_down'; } } image = the image checkbox = hidden field. Link to comment https://forums.phpfreaks.com/topic/218834-i-need-to-use-checkbox-which-looks-like-button/#findComment-1139737 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.