Re: Users' unintentional use of "Enter" causing data loss

bugant <[email protected]> Wed, 22 Mar 2006 09:49:25 +0100
Newsgroups gmane.comp.apache.mod-survey.general
Message-ID <[email protected]>
hi,

Joel Palmius wrote:
> You are pointing at a bug though. The user should be notified that his 
> key is illegal when submitting. Did this not happen?

so maybe setting the last question as mandatory (MUSTANSWER="yes")
should do the trick ;)

> BugAnt: You did some stuff with key bindings for answering a survey. Any 
> way to prevent enter from submitting form?

I think you could use javascript to prevent this.

function noSub(e) {
    var realkey = String.fromCharCode(e.which);
    var nkey=e.which;
    if (nkey == 13) {
	alert('You've pressed return');
	return;
    }
}

and letting this been used on your survey file:

<SURVEY ....
         ....
         ACCESSJS="yourfile.js"
         ACCESSFUN="noSub"
 >

obviously you wan't alert user with that message ;) I think
so you should change the code above to feet your needs.

stay tuned,
bugant.
Skickat av bugant <[email protected]>
till survey-discussion