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:253806
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to