I get the following javascript error on using form check module of js tools.

    Error: document.getElementById("formcheck-message") has no properties
Source File: http://125.125.125.25/drupal47/modules/formcheck/formcheck.js
Line: 86
   

I have installed the formcheck module individually & at formcheck settings options I have selected selected page node type where the form checking will be applied.
I get the above mentioned java script error.

Thanks.
sanjeev gupta

Comments

nedjo’s picture

Status: Active » Fixed

Okay, I've made the message text hard-coded instead of passing it via a form element. We can fix this when we introduce a js localization approach.

Anonymous’s picture

Status: Fixed » Closed (fixed)
wrunt’s picture

This is still broken for me in the latest 4.7 release under firefox (haven't tested in other browsers).

The problem is that the formcheck-message element has two id attributes, one added by formcheck.module, the other added by the forms api. To fix this do the following:

In formcheck.module, comment out line 38 like so:

      //'#attributes' => array('id' => 'formcheck-message')

And in formcheck.js, change this line:

    var message = document.getElementById('formcheck-message').value;

to this:

    var message = document.getElementById('edit-formcheck').value;

This uses the id that the forms api gives the element, instead of adding and using our own id.