215 Posts
cubist
10 years ago
1
Topic
Seems like this should be somewhere ... but did not find anything in the forums.
I'm trying to disable the Return or Enter Key from actually submitting the form.
Is there easy way to do that OR must I use jQuery?
Anyone tried it?
Thx!


I ended up adding a required field that reads basically asks:

Are you ready to submit the form? and made it required and if checked, reveals the Submit Button
Get a VIP membership
52 Posts
paulbr
10 years ago
0
Level 1
Hi cubist,

you can disable the submit button with conditionals.
when a required field is filled then activate it.

or disable the enter key general width a javascript function
e.g.
function stopRKey(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && (node.type=="text")) {
return false;
}
}
window.onload = function() {
document.onkeypress = stopRKey;
};



Paul
Get a VIP membership