Support Forums
ATutor Support
How to stop the "enter" key from submitting a test/survey
You must be signed-in to post.
| Author | Subject | |
|---|---|---|
| Page: 1 | ||
| gtilflm | Subject: How to stop the "enter" key from submitting a test/survey | |
| Hello. I've been noticing that when students are entering an answer to a text box and they press "Enter", it submits the test. Of course, they don't need to do that, but when they do it submits and incomplete test. Would there be a way to.... 1.) Disassociate the enter button and the submit action, or, 2.) Have a pop-up appear that says, "Would you like to submit this test?" with a Yes/No option. Thank you! Posted: 2009-10-29 13:01:35 | ||
harris![]() | Subject: Re: How to stop the | |
| Are all questions on the same page? Posted: 2009-10-29 14:13:50 | ||
| gtilflm | Subject: Re: How to stop the | |
| Yes. They are. Posted: 2009-10-29 14:20:05 | ||
greg![]() | Subject: Re: How to stop the | |
| There's not a confirmation currently when submitting a test, but that would be a good feature. I've added it to the tracker: www.atutor.ca/atutor/mantis/view.php?id=3980 Posted: 2009-10-30 13:57:32 | ||
| gtilflm | Subject: Re: How to stop the | |
| Greg, Ok. In the meantime, is there any way to turn off the "enter button = sumbit" behavior by code? Thank you. Posted: 2009-10-30 14:09:02 | ||
greg![]() | Subject: Re: How to stop the | |
| You'd need to replace it with a javascripted button. Google it. There'll be examples you can copy from. Posted: 2009-10-30 14:20:29 | ||
| gtilflm | Subject: Re: How to stop the | |
| Solved. For those that are interested, here's what I did. Following the instructions at www.arraystudio.com/as-workshop/disable-form-submit-on-enter-keypress.html... 1. Insert the following into ATutor/themes/your_theme/include/header.tmpl.php 2. Any question types with an input field in ATutor/your_theme/default/test_questions/question_type_with_text_input_area put: into the <input> tag. Like this: <input type="text" onKeyPress="return disableEnterKey(event)" name="answers[<?php echo $this->row['question_id']; ?>]" class="formfield" size="15" value="<?php echo htmlspecialchars($this->response); ?>" /> Enjoy! Posted: 2009-10-30 17:56:25 | ||
| Page: 1 | ||
You must be signed-in to post.




