-3

I am getting an error as in the title when I open the console in Chrome and Firefox. However, everything is working fine on older browser like older IE versions. You can check this image.

I am attaching the script:

function MoveNext()
{
    var qno = document.getElementById("txtQueNo").value;
    var qcode = document.getElementById("txtQueCode").value;
    var quetot = document.getElementById("quetot").value;
    var que_avl = document.getElementById("que_avl").value;
    var stdid = document.getElementById("txtStdID").value;
    var oltid = document.getElementById("txtOLTID").value;
    var ans = document.getElementById("txtAnswer").value;
    var time =  document.getElementById("disp").value;

I'm adding the full script for reference.

The issue is on the last line of the above code.

Thank you.

1 Answers1

0

The only occurrence of "disp" in your php is as a name and not an ID (id="txt").

You can use document.getElementsByName("disp")[0].value instead. This will of course return an array of all elements with name="disp" but as you only have one in the php provided, this should be the correct assignment for the 0 based index.

Glitch_Doctor
  • 2,994
  • 3
  • 16
  • 30