On Mon, Nov 20, 2017 at 8:22 PM, Craig Russell <[email protected]> wrote:
> I have a bug that I cannot figure out.
>
> Load the demo whimsy/project/icla and the form shows up just fine. Since the 
> fields are not filled, the (Preview Invitation) button is not active. The 
> form fields are outlined in red, indicating that there are errors (empty is 
> not an option here).
>
> Fill the three form fields and the (Preview Invitation) button is still not 
> active. It should be active.
>
> Change the project and the (Preview Invitation) button is active.
>
> There is also a message, perhaps related, on the javascript console:
>
> [Error] TypeError: null is not an object (evaluating 
> 'document.getElementById(id).checkValidity')
>         (anonymous function) (app.js:668)
>         every
>         checkValidity (app.js:667)
>         setPMC (app.js:591)
>
> The way this should work is that if the vote/notice field is filled, it is 
> validated against the current pmc field value. This part seems to work ok, 
> but the enabling of the preview the first time the pmc field is filled is not 
> working.
>
> Any ideas?

Here's the code:

  def checkValidity()
    @disabled = !%w(iclaname iclaemail pmc votelink noticelink).all? do |id|
      document.getElementById(id).checkValidity()
    end
  end

Once EVERY one of those fields is valid, @disabled will be set to
false.  At which point, preview invitation will no longer be disabled:

      _button.btn.btn_primary 'Preview Invitation', disabled: @disabled,
        onClick: self.previewInvitation

Since you are getting an error message, one of those fields is not
present (in other words, document.getElementById(id) returns null).

> Craig L Russell
> Secretary, Apache Software Foundation
> [email protected] http://db.apache.org/jdo

- Sam Ruby

Reply via email to