//Begin function edit1_onblur function edit1_onblur(ctrl) { if(document.getElementById("edit1").value != "") { document.getElementById("textarea1").disabled = true; document.getElementById("textarea1").style.bgcolor = "lightgrey"; } else { document.getElementById("textarea1").disabled = false; //document.getElementById("textarea1").background-color = "white"; } } //End function edit1_onblur </SCRIPT>
document.getElementById("textarea1").background-color = "lightgrey"; document.getElementById("textarea1").background-color = "#B0B0B0"; document.getElementById("textarea1").style.bgcolor = "lightgrey";
if(document.formOne.fieldInfo.checked) { document.forms['myFormId'].myTextArea.setAttribute('readOnly','readOnly'); } else if(!document.formOne.fieldInfo.checked) { document.forms['myFormId'].myTextArea.setAttribute('readOnly',false); // also tried document.formOne.fieldtextarea.focus(); }
//Begin function edit1_onblur function edit1_onblur(ctrl) { if(document.getElementById("edit1").value != "") { document.getElementById("textarea1").setAttribute('readOnly','readOnly'); } else { document.getElementById("textarea1").setAttribute('readOnly',false); } } //End function edit1_onblur
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <script type="text/javascript"> var oTxt; var dC='#E5E5E5';//disabled color var eC='#FFFFFF';//enabled color function endis(n){ var oRads = document.getElementsByName(n); if(oRads[0].checked){//if the first radio button is checked oTxt.removeAttribute('readOnly'); oTxt.style.backgroundColor=eC; } else{ oTxt.value=''; oTxt.setAttribute('readOnly',true) oTxt.style.backgroundColor=dC; } } onload=function(){ oTxt = document.getElementsByName('txt')[0]; oTxt.style.backgroundColor=dC; oTxt.setAttribute('readOnly',true) } </script> </head> <body> <form> <input name="rad" type="radio" value="" onclick="endis(this.name)">enable textfield <br> <input name="rad" type="radio" value="" onclick="endis(this.name)">disable textfield <br> <input name="txt" type="text"> </form> </body> </html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <script type="text/javascript"> var oTxt1; var dC='#E5E5E5';//disabled color var eC='#FFFFFF';//enabled color function endis(n){ var oRads = document.getElementById("edit1"); if(oRads.value != ""){// if text1 != "" a space means it is not blank oTxt.removeAttribute('readOnly'); oTxt.style.backgroundColor=eC; } else{ oTxt.value=''; oTxt.setAttribute('readOnly',true) oTxt.style.backgroundColor=dC; } } onload=function(){ oTxt = document.getElementById('edit2'); oTxt.style.backgroundColor=dC; oTxt.setAttribute('readOnly',true) } </script> </head> <body> <form> <input id=edit1 name="text1" type="text" value=""> Enter Text Box 1 <br> <input id=edit2 name="text2" type="text" value="" onfocus="endis(this.id)">Enter Text Box 2 if Text 1 is not blank! <br> </form> </body> </html>
<script type="text/javascript"> var dC="#E5E5E5";//disabled color var eC="#FFFFFF";//enabled color function endis(n) { oRads = document.getElementById("edit1"); oTxt = document.getElementById(n); if (oRads.value != "" && oRads.value != null) { // if text1 != "" a space means it is not blank oTxt.removeAttribute("readOnly"); oTxt.style.backgroundColor=eC; } else { oTxt.value=""; oTxt.setAttribute("readOnly",true) oTxt.style.backgroundColor=dC; } } onload=function() { oTxt = document.getElementById("edit2"); oTxt.style.backgroundColor = dC; oTxt.setAttribute("readOnly",true) oRads = document.getElementById("edit1"); oRads.focus(); } </script>
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | ||
WebFOCUS App Studio 8.2.06 standalone on Windows 10 |