Thanks for your reply. I have tried that and get a strange error, as follows:
setting a property that has only a getter
elem.style[MochiKit.Base.camelize(name)]=_42a[name];
In your case 'message' variable is considered as a single text node.
You need something like:
if (!field1 || field.value == ''){
message = SPAN(message, BR(), get_string('field1isrequired'));
}
...
I have created a new form in the files section - similar to that or the edit form. If the user forgets to populate a field I have successfully got it coming up with an error. If there are two error I would like each error to be on a line of its own, but <br> in my javascript seems to be made safe when written to the page as <br>. Does anyone know how to do this.
an excerpt of code is below [filebrowser.js]:
if (!field1 || field.value == ''){
message += '<br>'+get_string('field1isrequired');
}
if (message) {
e.stop();
replaceChildNodes(self.id + '_form_messages', makeMessage(message, 'error'));
return false;
}
Thanks,
Mark
]]>