[thelist] Styling the input tag button..mmmwahahhahahah!

Tom Dell'Aringa pixelmech at yahoo.com
Mon Mar 31 13:21:28 CST 2003


Yes yes, I know, its impossible blah blah blah. This is just for fun
at this point. 

The below little snippet works in IE. The file input object is merely
set not to display and the button calls the click() method of the
input button. Then, on the onchange event of the input object, I toss
in the value (the file selected) into my text box. Neato.

I'm assuming (heh) that even though the display of the input object
is set to display: none, it will still function correctly.

Now - this does NOT work in NS7 (didn't check on others.) I THINK its
because the click() is not firing off there. I can only guess since
the JS tool doesn't even fire off a warning about what is going on.

Any ideas? Below is the code.

Tom
====================================
<html>
<head>
	<title>Untitled</title>
<style>
.button {
	font-size: 8pt;
	background: #016879;
	color: #ffffff;
	border-top: 2px solid #339999;
	border-left: 2px solid #339999;
	border-right: 2px solid #000033;
	border-bottom: 2px solid #000033;
}
</style>
</head>

<body>
<form name="test">
<input type="file" name="fi" style="display: none;"
onchange="this.form.tx.value = this.value;" />
<input type="text" name="tx" size="40" /> <input type="button"
value="Browse" onclick="this.form.fi.click();" class="button" />
</form>


</body>
</html>

=====
http://www.pixelmech.com/
var me = tom.pixelmech.webDeveloper();

http://www.maccaws.com/
[Making A Commercial Case for Adopting Web Standards]

"That's not art, that's just annoying." -- Squidward

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com


More information about the thelist mailing list