Simple question, I know, but I've been at this 100 different ways and nothing achieves the result I want: a simple welcome message on the user login form. Hook_form_alter gives me an undefined error and adding form elements through the drupalgap.js results in other issues. Does anyone know how to do this?

Comments

tyler.frankenstein’s picture

Status: Active » Needs review

You can try to use the form prefix/suffix:

http://www.drupalgap.org/node/276

Or you can place an element on the form as markup:

form.elements['my_markup'] = {
  markup: '<p>Hello</p>'
};
eudaemonia’s picture

Placing the element on the page does print the message (Hello) on the form, but it also prints "undefined" just above it. How do I remove the undefined? Does 'my_markup' need to be defined somewhere else? Thanks for your quick reply.

tyler.frankenstein’s picture

Category: Support request » Bug report
Status: Needs review » Closed (fixed)

Actually, it turns out there was a bug with this. Thanks for reporting this problem.

Grab the latest bin/drupalgap.js file for this fix (it also fixes the "undefined" problem): http://drupalgap.org/download

I've also updated the documentation to include an example of form element markup:

http://www.drupalgap.org/node/278