[thelist] JavaScript: detecting and undoing radio button change

Roger Ly evolt at matchpenalty.com
Wed Apr 2 14:49:46 CST 2003


Try this:

function clearText()
{
	if (confirm('do you want to do this?'))
	{
		// perform the text field clearing here
		return true;
	}
	else
	{
		return false;
	}
}

<input type="radio" ... onclick="return clearText();"/>

returning false in the onclick handler suppresses the radio button from
being selected.

Hope that helps,

Roger



More information about the thelist mailing list