-4

I have an asp page with a Jscript calendar in it but keep getting the message below

****Unable to get property 'FromDate' of undefined or null reference****

The code I've run is:

<INPUT class=DateButton style="POSITION: relative" onclick="ShowCalendar(this.form.FromDate.value,  this,  this.form.FromDate)" type=button value=" >>> " name=cmdShowCalendar>
    </TD></TR>
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335

1 Answers1

1

The error message says that this.form is undefined or null. That means that the input doesn't belong to a form. So either:

  • Put it in a <form>
  • Use the form attribute to identify the form it belongs to
  • Use some other DOM method to find the element you are trying to reference
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • @TimHarnett — Below what? Without seeing the code, and based on that statement, my best guess is [that you have this problem](http://stackoverflow.com/questions/5967564/form-inside-a-table) and that you should use [a validator](http://validator.w3.org/nu/) – Quentin Jul 25 '16 at 14:20
  • @TimHarnett — Edit the question. Put the HTML into the **question**. Not the ASP, the HTML that the ASP outputs. See [MCVE] – Quentin Jul 25 '16 at 14:40
  • @TimHarnett — Click edit and put the code in the question. Don't put it in a comment. Make sure it is a [MCVE] – Quentin Jul 25 '16 at 15:04