- removing a warning

- moving color change on Check to the field itself, not to error$i container. error$i container is now useless and removed.
- changing active color to grey, yellow being for mandatory fields.
This commit is contained in:
tipaul 2006-06-02 15:26:57 +00:00
parent 4405ebad74
commit d216d82abd
1 changed files with 22 additions and 20 deletions

View File

@ -67,7 +67,7 @@
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->">
<!-- TMPL_UNLESS name="hide_marc" -->
<a title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></a>
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#ffff00;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#DDDDDD;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<!-- TMPL_ELSE -->
<input tabindex="1" type="hidden" name="indicator" value="<!-- TMPL_VAR NAME="indicator" -->">
<!-- /TMPL_UNLESS -->
@ -125,7 +125,7 @@
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->">
<!-- TMPL_UNLESS name="hide_marc" -->
<a title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></a>
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#ffff00;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#DDDDDD;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<!-- TMPL_ELSE -->
<input tabindex="1" type="hidden" name="indicator" value="<!-- TMPL_VAR NAME="indicator" -->">
<!-- /TMPL_UNLESS -->
@ -183,7 +183,7 @@
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->">
<!-- TMPL_UNLESS name="hide_marc" -->
<a title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></a>
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#ffff00;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#DDDDDD;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<!-- TMPL_ELSE -->
<input tabindex="1" type="hidden" name="indicator" value="<!-- TMPL_VAR NAME="indicator" -->">
<!-- /TMPL_UNLESS -->
@ -241,7 +241,7 @@
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->">
<!-- TMPL_UNLESS name="hide_marc" -->
<a title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></a>
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#ffff00;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#DDDDDD;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<!-- TMPL_ELSE -->
<input tabindex="1" type="hidden" name="indicator" value="<!-- TMPL_VAR NAME="indicator" -->">
<!-- /TMPL_UNLESS -->
@ -300,7 +300,7 @@
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->">
<!-- TMPL_UNLESS name="hide_marc" -->
<a title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></a>
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#ffff00;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#DDDDDD;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<!-- TMPL_ELSE -->
<input tabindex="1" type="hidden" name="indicator" value="<!-- TMPL_VAR NAME="indicator" -->">
<!-- /TMPL_UNLESS -->
@ -359,7 +359,7 @@
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->">
<!-- TMPL_UNLESS name="hide_marc" -->
<a title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></a>
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#ffff00;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#DDDDDD;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<!-- TMPL_ELSE -->
<input tabindex="1" type="hidden" name="indicator" value="<!-- TMPL_VAR NAME="indicator" -->">
<!-- /TMPL_UNLESS -->
@ -418,7 +418,7 @@
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->">
<!-- TMPL_UNLESS name="hide_marc" -->
<a title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></a>
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#ffff00;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#DDDDDD;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<!-- TMPL_ELSE -->
<input tabindex="1" type="hidden" name="indicator" value="<!-- TMPL_VAR NAME="indicator" -->">
<!-- /TMPL_UNLESS -->
@ -477,7 +477,7 @@
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->">
<!-- TMPL_UNLESS name="hide_marc" -->
<a title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></a>
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#ffff00;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#DDDDDD;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<!-- TMPL_ELSE -->
<input tabindex="1" type="hidden" name="indicator" value="<!-- TMPL_VAR NAME="indicator" -->">
<!-- /TMPL_UNLESS -->
@ -536,7 +536,7 @@
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->">
<!-- TMPL_UNLESS name="hide_marc" -->
<a title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></a>
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#ffff00;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#DDDDDD;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<!-- TMPL_ELSE -->
<input tabindex="1" type="hidden" name="indicator" value="<!-- TMPL_VAR NAME="indicator" -->">
<!-- /TMPL_UNLESS -->
@ -595,7 +595,7 @@
<input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->">
<!-- TMPL_UNLESS name="hide_marc" -->
<a title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></a>
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#ffff00;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#DDDDDD;'" type="text" name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->"> -
<!-- TMPL_ELSE -->
<input tabindex="1" type="hidden" name="indicator" value="<!-- TMPL_VAR NAME="indicator" -->">
<!-- /TMPL_UNLESS -->
@ -673,7 +673,6 @@
function _(s) { return s } // dummy function for gettext
function openAuth(tagid,authtype,subfieldid) {
alert("SI"+subfieldid);
defaultid=document.getElementById(subfieldid);
newin=window.open("../authorities/auth_finder.pl?authtypecode="+ authtype+ "&index="+ subfieldid+ "&tagid="+tagid+"&result=", "value builder",'width=550,height=550,toolbar=false,scrollbars=yes');
}
@ -717,21 +716,23 @@ function Check(f) {
// mandatory, or if something else in the tag is entered
if (f.tag_mandatory[i].value == 1 || field_is_nonempty_p[f.tag[i].value]) {
document.getElementById("error"+i).style.backgroundColor="#FF0000";
// document.getElementById("error"+i).style.backgroundColor="#FF0000";
f.field_value[i].style.backgroundColor="#FF0000";
total_missing_mandatory_subfields++;
if (document.getElementById("error"+i).parentNode.tagName == "B")
if (f.field_value[i].parentNode.tagName == "B")
{
missing_mandatory_subfields.push(document.getElementById("error"+i).innerHTML + " (tab " + document.getElementById("error"+i).parentNode.parentNode.parentNode.parentNode.id.substr(0,1) + ")");
missing_mandatory_subfields.push(f.field_value[i].innerHTML + " (tab " + f.field_value[i].parentNode.parentNode.parentNode.parentNode.id.substr(0,1) + ")");
}
else
{
missing_mandatory_subfields.push(document.getElementById("error"+i).innerHTML + " (tab " + document.getElementById("error"+i).parentNode.parentNode.parentNode.id.substr(0,1) + ")");
missing_mandatory_subfields.push(f.field_value[i].innerHTML + " (tab " + f.field_value[i].parentNode.parentNode.parentNode.id.substr(0,1) + ")");
}
}
} else {
// alert("I = "+i);
document.getElementById("error"+i).style.backgroundColor="#FFFFFF";
// document.getElementById("error"+i).style.backgroundColor="#FFFFFF";
f.field_value[i].style.backgroundColor="#FFFFFF";
}
}
@ -745,16 +746,17 @@ function Check(f) {
if (seen_mandatory_tag_p[j] != 1) {
seen_mandatory_tag_p[j] = 1;
total_missing_mandatory_tags++;
if (document.getElementById("error"+i).parentNode.tagName == "B")
if (f.field_value[i].parentNode.tagName == "B")
{
missing_mandatory_tags.push(document.getElementById("error"+i).innerHTML + " (tab " + document.getElementById("error"+i).parentNode.parentNode.parentNode.parentNode.id.substr(0,1) + ")");
missing_mandatory_tags.push(f.field_value[i].innerHTML + " (tab " + f.field_value[i].parentNode.parentNode.parentNode.parentNode.id.substr(0,1) + ")");
}
else
{
missing_mandatory_tags.push(document.getElementById("error"+i).innerHTML + " (tab " + document.getElementById("error"+i).parentNode.parentNode.parentNode.id.substr(0,1) + ")");
missing_mandatory_tags.push(f.field_value[i].innerHTML + " (tab " + f.field_value[i].parentNode.parentNode.parentNode.id.substr(0,1) + ")");
}
}
document.getElementById("error"+i).style.backgroundColor="#ffff00";
//document.getElementById("error"+i).style.backgroundColor="#ffff00";
f.field_value[i].style.backgroundColor="#FFFF00";
}
}