浏览代码

Moved custom field's placement

父节点
当前提交
74c102beaf
共有 2 个文件被更改,包括 10 次插入7 次删除
  1. 1
    1
      README.md
  2. 9
    6
      front/form.js

+ 1
- 1
README.md 查看文件

120
 
120
 
121
 ## Custom fields
121
 ## Custom fields
122
 
122
 
123
-SMAM allows you to add custom fields to your form (in addition to the default ones, which are the sender's name, the sender's e-mail address, the message's subject and the message's content). These fields will be added in your form below the content's field, in a tag defined by the settings file (one of <input>, <select> and <textarea>). We'll see below how to set the field's type.
123
+SMAM allows you to add custom fields to your form (in addition to the default ones, which are the sender's name, the sender's e-mail address, the message's subject and the message's content). These fields will be added in your form just above the content's field, in a tag defined by the settings file (one of <input>, <select> and <textarea>). We'll see below how to set the field's type.
124
 
124
 
125
 A custom field is defined in the `customFields` section of your settings file, as described below:
125
 A custom field is defined in the `customFields` section of your settings file, as described below:
126
 
126
 

+ 9
- 6
front/form.js 查看文件

130
 			label: lang.form_subj_label,
130
 			label: lang.form_subj_label,
131
 			type: 'text',
131
 			type: 'text',
132
 			required: true
132
 			required: true
133
-		}),
134
-		text: getField({
135
-			name: items.text,
136
-			label: lang.form_mesg_label,
137
-			type: 'textarea',
138
-			required: true
139
 		})
133
 		})
140
 	};
134
 	};
141
 
135
 
145
 		DOMFields[fieldName] = getField(field);
139
 		DOMFields[fieldName] = getField(field);
146
 	}
140
 	}
147
 
141
 
142
+	// Add the message's textarea
143
+	DOMFields[text] = getField({
144
+		name: items.text,
145
+		label: lang.form_mesg_label,
146
+		type: 'textarea',
147
+		required: true
148
+	});
149
+
148
 	// Adding all nodes to document
150
 	// Adding all nodes to document
149
 	for(let field in DOMFields) {
151
 	for(let field in DOMFields) {
150
 		el.appendChild(DOMFields[field]);
152
 		el.appendChild(DOMFields[field]);
151
 	}
153
 	}
152
 
154
 
155
+
153
 	// Adding submit button
156
 	// Adding submit button
154
 	el.appendChild(getSubmitButton('form_subm', lang.form_subm_label));
157
 	el.appendChild(getSubmitButton('form_subm', lang.form_subm_label));
155
 
158