Решение было найдено самостоятельно:
1. Заменил все
<span id="error_text_XXX">
на
<span id="XXX">
var buildPrompt = function(caller,promptText) {
var divFormError = document.createElement('div')
var formErrorContent = document.createElement('div')
var spanIdfromDiv = document.getElementById($(caller).attr("name"))
$(divFormError).addClass("formError")
$(divFormError).addClass($(caller).attr("name"))
$(formErrorContent).addClass("formErrorContent")
$(spanIdfromDiv).append(divFormError)
$(divFormError).append(formErrorContent)
$(formErrorContent).html(promptText)
$(divFormError).fadeTo("fast",0.8);
};