I build a custom form:

function zzb_askquestion_form(form, form_state) {
  try {
    form.elements['title'] = {
      type: 'textfield',
      title: 'Title',
      required: true
    };
	form.elements['body1'] = {
	  title: 'Question descrition',
	  type: 'textarea',
	};
    form.elements['submit'] = {
      type: 'submit',
      value: 'Save'
    };
    return form;
  }
  catch (error) { console.log('zzb_askquestion_form - ' + error); }
}

it works correctly,

if I change "body1" to "body":

function zzb_askquestion_form(form, form_state) {
  try {
    form.elements['title'] = {
      type: 'textfield',
      title: 'Title',
      required: true
    };
	form.elements['body'] = {
	  title: 'Question descrition',
	  type: 'textarea',
	};
    form.elements['submit'] = {
      type: 'submit',
      value: 'Save'
    };
    return form;
  }
  catch (error) { console.log('zzb_askquestion_form - ' + error); }
}

I get a "UNDEFINED" message, the form does no display.

Comments

tyler.frankenstein’s picture

Status: Active » Postponed (maintainer needs more info)

Please send a screen shot and/or a copy/paste of the console.log() message(s) that show the "undefined" message.

Either way, very strange. I don't see why body vs body1 would cause any problems.