Re: Users' unintentional use of "Enter" causing data loss
bugant <[email protected]> Wed, 22 Mar 2006 13:48:41 +0100
| Newsgroups | gmane.comp.apache.mod-survey.general |
|---|---|
| Message-ID | <[email protected]> |
hi,
bbbart wrote:
>>function noSub(e) {
>> var realkey = String.fromCharCode(e.which);
>> var nkey=e.which;
>> if (nkey == 13) {
>> alert('You've pressed return');
>> return;
>> }
>>}
>
>
> what do you use the var realkey for?
oops I forgot it so simply ignore it.
> and, are you sure that this would prevent submitting the form? I'm not
> sure how the browser would handle the 'enter' event after processing the
> javascript.
no :( you're right it goes on after the event has been processed so the
form will be submited.
[snip]
> to me, the best way is to either make all the answers mandatory
> (MUSTANSWER=yes) or, if that is not desirable, to educate your users. :-)
I agree ;)
cheers,
bugant.
Skickat av bugant <[email protected]>
till survey-discussion