This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Replacing the radio buttons and checkboxes with custom images

Hi !
Could anybody help me with the creation of a new module to replace the radio buttons and checkboxes with custom images ?

I have the javascript ready to work but I don't know how to put it in a Drupal module. I've found this tutorial http://drupal.org/node/42544 but.... well I'm not so good with php :)

So here's the script

function chgCB(){
CHKB = document.getElementById('newCB').getElementsByTagName('input');
for(i=0; i < CHKB.length; i++){
if(CHKB[i].type == "checkbox"){
IMG = document.createElement('img');
CHKB[i].parentNode.insertBefore(IMG, CHKB[i]);
IMG.src = "radio0.gif";
if(CHKB[i].checked == true) IMG.src = "radion.gif";
if(CHKB[i].disabled == true) IMG.src = "radio.gif";
else{ // Changing state's behaviours are only applied if the box is clickable
CHKB[i].onchange = function(){
IMG = this.parentNode.getElementsByTagName('img')[0];
if(this.checked == true) IMG.src = 'radion.gif'
else IMG.src = 'radio0.gif'
}
if(!window.sidebar){
CHKB[i].parentNode.onclick = function(){
CHK = this.getElementsByTagName('input')[0];
CHK.checked = (CHK.checked == true) ? false : true;
CHK.onchange()
}
}
}
CHKB[i].style.visibility = 'hidden';
CHKB[i].style.position = 'absolute';

Where is the paypal_framework module?

I've looked in the modules directory list, but can't find it there. I've also Googled it and followed a link to this site which is now dead...Any ideas?

Remind users to post/blog/create content RFC

I have a created a couple sites for people but they are sort of newbies and I would like to be able to have an email be sent to them automatically every so often if they haven't created a node in a while. Otherwise their site can be a bit boring without some new content once in a while. Here is some pseudo-code. I would be glad to hear anyone's comments, especially if there is something that almost does this already.

Caching

Does anyone know how drupal handles its caching? Especially, I'd be interested to know whether node_counter increases when drupal caching is enabled.

drupal_add_js and collapse issues

i have two questions:

using drupal_add_js, is there a way to add my js file after all of the drupal js files? so that my js file can see the changes made to the page.

how can i attach collapsing function of any fieldset to an object other than fieldset's legend? for example when a checkbox is checked/unchecked a fieldset will open/collapse. (the reverse situation is not important: when the fieldset is opened/collapsed by clicking its legend, the checkbox's status may not change.)

thanks.

Free the Books module!

I'm just wondering if anyone else feels the same way:

1) I prefer books to taxonomy as *most* of my site is hierarchical.

2) That makes books more logical for viewers and non-techie users of the site.

3) The 'Outline' feature ROCKS!

4) But it would be great to be able to have two parents.

I know that kinda veers into taxonomy territory, but even if it was something like a distant parent, or step-parent (with breadcrumbs still honouring the primary parent), I think it would be a big improvement to the books module.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions