"Oxnard" <sh******@no-spam.comcast.net> writes:
Here's the script section:
The script is IE-only. Not very good for internet use.
A more compatible version would be:
---
function change(event, color) {
var elem = event.target || event.srcElement;
if (elem.tagName == "INPUT" && elem.type == "button") {
elem.style.backgroundColor = color;
}
}
---
if the form uses a type=button when kyou rollover the button it changes
form onMouseover="change('87cefa')" onMouseout="change('d3d3d3')"
input type="button" value="Hosting " class="color2"
onClick="jumpto2('hosting.html')"
There is some markup missing here (no "<"'s and ">"'s).
however if the input type is submit instead of button when the button is
rolled over it does not change color
Ofcourse. The script tests for (elem.type=="button"), so it won't
match an input element with type="submit".
here is what I mean:
.... My question is if the method is post and the input type is submit anyway to
make it rollover?
The form's method is not relevant. It is the type of the button that
fails to be "button". If you want the script to also work on submit
and reset buttons, you can use:
---
function change(event, color) {
var elem = event.target || event.srcElement;
if (elem.tagName == "INPUT" &&
( elem.type == "button" ||
elem.type == "submit" ||
elem.type == "reset")) {
elem.style.backgroundColor = color;
}
}
---
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'