[thelist] event handlers in a stylesheet?

Eric Engelmann eric at geonetric.com
Mon Mar 11 19:40:01 CST 2002


Looking for an elegant way to do this:

[input
	type="text"
	name="FirstName"
	value="something"
	size="3"
	style="border: none;"
	onclick="this.style.border='1px #cccccc
solid';this.size=this.value.length+10;"
ondeactivate="this.size=this.value.length;"
]

for each field on a very large form.

I wish I could do:

[style]
	.formelement {
	border: none;
	onclick="this.style.border='1px #cccccc
solid';this.size=this.value.length+10;"
ondeactivate="this.size=this.value.length;"
	}
[/style]

and just put class="formelement" in each one that I wanted to have this.

Of course that doesn't work at all.

I'd rather not repeat that for every element, any brilliant hacks out there?
Its an IE-specific application, so that's ok if its got MS-specific stuffs
in it.

- Eric





More information about the thelist mailing list