I’m no Javascript expert, but tried to write a script to change my contact form’s inputs when the user gives it focus. The problem is that it doesn’t work. However I can get it to work if I replace ‘input’ with the form inputs id. So what I need is how to make ‘input’ be universal to the form. Below is the html and JS:
[code=php]
function on(input) {
v = document.getElementById( “contact” );
v.input.style.background = ‘#FFF’;
v.input.style.border = ‘1px solid #9A9A9A’;
}
function off(input) {
v = document.getElementById( “contact” );
v.input.style.background = ‘#F7F7F7’;
v.input.style.border = ‘1px solid #E0DFE3’;
}
<form action=”./fghfgh.php” method=”post” id=”contact”>
<input type=”text” id=”name” name=”name” onfocus=”on(this);” onblur=”off(this);” class=”contactfield” />
etc………..
Thanks for your time.