I'll have to admit... I didn't think of that at all ;-)

-----Original Message-----
From: Peter Boughton [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 22, 2006 6:59 AM
To: CF-Talk
Subject: Re: How do I use JS to let someone know a test question needs to be
answered

>To add to Charlie's response... use a type="button" not "submit" then put
an
>onlcick that will submit() the form so without JS, they cant submit it so
>they can't circumvent your timer by simply turning off JS

Just typing "javascript:doSubmit=null;" into the address bar will circumvent
it, and allow the user to submit whenever they want.


(One solution is to also add an encrypted timestamp form field which CF can
then decrypt and check it is within a certain limit, bearing in mind that
you need to cater for connection/transfer time and page rendering time, so
you may need to set it to five or ten seconds above your JS limit, if it's
potentially used by slow people... uh, people on slow machines/connections,
that is)



--
Peter

>LOL! "Who's your daddy"
>
>To add to Charlie's response... use a type="button" not "submit" then put
an
>onlcick that will submit() the form so without JS, they cant submit it so
>they can't circumvent your timer by simply turning off JS
>
>-----Original Message-----
>From: Charlie Griefer [mailto:[EMAIL PROTECTED] 
>Sent: Thursday, September 21, 2006 8:33 PM
>To: CF-Talk
>Subject: Re: How do I use JS to let someone know a test question needs to
be
>answered
>
>start with this.
>
>you can mess with the intervals by replacing the static 5000 and 10000
>with values from the database (just remember it's miliseconds...not
>seconds).
>
><html>
><head>
>       <script type="text/javascript">
>               function doSubmit() {
>                       alert("You blew it!");
>                       document.myForm.submit();
>               }
>               
>               function alertUser() {
>                       alert("You're gonna blow it!  5 seconds to go...");
>               }
>
>               setTimeout('alertUser()', 5000)
>               setTimeout('doSubmit()', 10000);
>       </script>
></head>
>
><body>
>
><form name="myForm" method="post" action="page2.cfm">
>       Who's your daddy? <input type="text" />
></form>
>
></body>
></html>
>
>On 9/21/06, Will Tomlinson <[EMAIL PROTECTED]> wrote:
>> I have a friend working on a testing application for his school class.
>> He wants to have a field for every question where the value would be a
>time limit - say 60 seconds.
>>
>> So he queries the db for the time limit for the question being presented
>to the user. How would we
>>
>> 1. Warn the user his time is almost up with JS
>> 2. When the time is up and the user hasn't answered, automatically submit
>the form anyway, passing a reponse value of false.
>>
>> I had thought of how you could do it server side, and this solution might
>end up needing both SS AND JS.
>>
>> Thanks,
>> Will
>>
>>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253837
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to