Jump to content

Auto submission of exam result when time is over


Go to solution Solved by kicken,

Recommended Posts

  • 3 weeks later...

I'm stuck guru requinix. . pls help me. I don't know how to use .submit() method.(as Im new to Javascript) . What I did is just loading the query(for inserting to DataBase). ex: process_exam.php automatically when time is Over using document.location='process_exam.php'; . When the page loaded it is only showing empty page and nothing happens. Instead of diplaying "YOU HAVE FINISHED THE EXAM" then the data have been save already to the database

  • Solution

First, make sure your form has an ID on it.

<form id="yourform">

 

Then you just get a reference to that form using getElementById() and call it's .submit() method.

document.getElementById('yourform').submit();

 

Just changing the location (document.location='blah';[/) like you did does not submit any of the form details, so your processing script would not have an of the data it needs to do it's job.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.