You are here: irt.org | About | Feedback | 5038 [ previous next ]
Feedback on:
irt.org FAQ Knowledge Base Q682
Sent by
gogo on Wednesday September 19, 2007 at 10:18:43
Worth:
Length:
Technical:
Comments:
//put this code any where between your <head> tags.
function addInputSubmitEvent(form, input) {
input.onkeydown = function(e) {
e = e || window.event;
if (e.keyCode == 13) {
form.submit();
return false;
}
};
}
window.onload = function() {
var forms = document.getElementsByTagName('form');
for (var i=0;i < forms.length;i++) {
var inputs = forms[i].getElementsByTagName('input');
var selects = forms[i].getElementsByTagName('select');
for (var j=0;j < inputs.length;j++)
addInputSubmitEvent(forms[i], inputs[j]);
for (var j=0;j < selects.length;j++)
addInputSubmitEvent(forms[i], selects[j]);
}
};
//<!-- Taken from: http://www.thefutureoftheweb.com/blog/submit-a-form-in-ie-with-enter
and improved a bit by http://useful.2ya.com -->
Other feedback on 'irt.org FAQ Knowledge Base Q682' - show all