Dear all,
I'd like to set a default value for a field, say school. In the JavaScript template, I inserted the following code (|| stands for square brackets):
function doload () {
if (document.getElementByID('||school#id||').value=="")
document.getElementByID('||school#id||').value='Sunrise Elementary School';
}
window.Xonload= doload
It did not work. However, if I replace ||school#id|| with the actual field id I looked up in the mdl_data_fields table, it worked. Can anyone explain why this had happened?
Thanks!