Monday, June 12, 2006

Make incorrectly populated fields blink on web

This tip shows how to make fields with incorrect values to blink with blue and red colors. The correctness of a field is verified against field's expected value.

blinking fields



click image to view in full size

Formula for the first computed field: @If(Field1="This field has correct value";"color:black";"color:blue; font-weight: bold")

Formula for the second computed field: @If(Field2="This field has correct value";"color:black";"color:blue; font-weight: bold")


Code on Form (remove space in tags):

< div id="field1" style="< Computed Value >">FIELD1< /div >
< div id="field2" style="< Computed Value >">FIELD2< /div >
< div id="field3" style="< Computed Value >">FIELD3< /div >

< script >
checkfield('field1');
checkfield('field2');
checkfield('field3');
< /script >



Code in JSHeader:

function blinkme(fldid) {
var fld=document.all[fldid];
if (fld.style.color=="red"){
fld.style.color="blue";
}else{
fld.style.color="red";
}
mytime=setTimeout("blinkme('"+fldid+"')",800);
}
function checkfield(fldid){
var fld=document.all[fldid];
if(fld.style.color=="blue"){
mytime=setTimeout("blinkme('"+fldid+"')",800);
}
}

1 comment:

Adi said...

Oes Tsetnoc one of the ways in which we can learn seo besides Mengembalikan Jati Diri Bangsa. By participating in the Oes Tsetnoc or Mengembalikan Jati Diri Bangsa we can improve our seo skills. To find more information about Oest Tsetnoc please visit my Oes Tsetnoc pages. And to find more information about Mengembalikan Jati Diri Bangsa please visit my Mengembalikan Jati Diri Bangsa pages. Thank you So much.