Skip to content

Instantly share code, notes, and snippets.

@bangpound
Created June 28, 2010 16:34
Show Gist options
  • Save bangpound/456066 to your computer and use it in GitHub Desktop.
Save bangpound/456066 to your computer and use it in GitHub Desktop.
/**
* reset all the radio buttons with a given name
*
* @param string fieldName
* @param object form
* @return null
*/
function unselectRadio(fieldName, form)
{
for( i=0; i < document.forms[form].elements.length; i++) {
if (document.forms[form].elements[i].name == fieldName) {
document.forms[form].elements[i].checked = false;
}
}
return;
}
<a onclick="unselectRadio('gender', 'Main');return false;" title="unselect" href="#">unselect</a>
@bangpound
Copy link
Author

from js/Common.js in CiviCRM 3.1.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment