Ohhh Firefox.... I have created a javascript that when you click in a box to update a value, the submit button grays out and the update buttons is active. This works fine in IE and Safari as well as if i call the javascript from a drop down menu onChange it works fine, just when i do a onKeyPress or onKeyDown. I have been doing research on this all morning and getting tired of it. The closest thing i found was doing something like this, but i can not figure out how to get it to work with my script.
Here is my input...
Here is my javascript to gray out the submit button and show the update button.
Code:
function EnterKey(e)
{
var key;
if(window.event)
key = window.event.keyCode; //IE
else
key = e.which; //firefox
if(key == 13)
return true;
else
return false;
}
Code:
<input size="2" tabindex="2" onkeydown="validate();" onblur="setFocus()" type="text" maxlength="3" name="qty<?php echo $prod_key; ?>" value="<?php echo $qty; ?>"/>
Here is my javascript to gray out the submit button and show the update button.
Code:
function validate( the_form ) {
var x=document.getElementById('update');
var y=document.getElementById('sale_pass');
var z=document.getElementById('reason');
var hide=document.getElementById('hide');
var hide_r=document.getElementById('hide_r');
var sale=document.getElementById('sale_type');
var car=document.getElementById('complete');
car.disabled = true;
x.style.visibility = 'visible';
if(sale.value != 'sale') {
y.style.visibility = 'hidden';
z.style.visibility = 'hidden';
hide.style.visibility = 'hidden';
hide_r.style.visibility = 'hidden';
}
//x.focus();
}
</script>
Comment