Ignore:
Timestamp:
07/05/05 15:59:21 (15 years ago)
Author:
gocher
Message:

Workaround for removeAttribute() and setAttribute()
problems with IE

for Example
object.setAttribute("readOnly",true) in IE
object.setAttribute("readOnly","readOnly") in Mozilla

Location:
trunk/plugins/Forms/popups
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/Forms/popups/fieldset.html

    r239 r254  
    1212        __dlg_init(); 
    1313        var param = window.dialogArguments; 
    14   document.getElementById("f_legend").value = param["f_legend"]; 
    15   document.getElementById("f_legend").focus(); 
     14  document.getElementById("f_text").value = param["f_text"]; 
     15  document.getElementById("f_text").focus(); 
    1616}; 
    1717 
     
    1919        // pass data back to the calling window 
    2020  var param = new Object(); 
    21   param["f_legend"] = document.getElementById("f_legend").value; 
     21  param["f_text"] = document.getElementById("f_text").value; 
    2222        __dlg_close(param); 
    2323  return false; 
     
    3636  <form action="" method="get"> 
    3737    <div class="fr">Legend:</div> 
    38     <input type="text" name="legend" id="f_legend" /> 
     38    <input type="text" name="text" id="f_text" /> 
    3939    <p /> 
    4040    <div id="buttons"> 
  • trunk/plugins/Forms/popups/input.html

    r239 r254  
    2222    case "text": 
    2323    case "password": 
    24       fields = ["f_name", "f_value", "f_readonly", "f_disabled", "f_tabindex", "f_accesskey", "f_size"]; 
     24      fields = ["f_name", "f_value", "f_readOnly", "f_disabled", "f_tabindex", "f_accesskey", "f_size", "f_maxLength"]; 
    2525      height = 350; 
    2626      document.getElementById("txt").style.display = "block"; 
     
    6363  for (var i in fields) { 
    6464    switch (fields[i]) {  
    65     case "f_readonly":  
     65    case "f_readOnly":  
    6666    case "f_disabled": 
    6767    case "f_checked": 
    68       document.getElementById(fields[i]).checked = param[fields[i]]=="true"; break; 
     68      document.getElementById(fields[i]).checked = (param[fields[i]]==fields[i].substring(2,20)) || (param[fields[i]] == true); break; 
    6969    default: 
    7070      document.getElementById(fields[i]).value = param[fields[i]]; break; 
     
    8484  // pass data back to the calling window 
    8585  var param = new Object(); 
    86   param["f_type"] = type; 
    8786  for (var i in fields) { 
    8887    switch (fields[i]) { 
    89     case "f_readonly": 
     88    case "f_readOnly": 
    9089    case "f_disabled": 
    9190    case "f_checked": 
    92       param[fields[i]] = (document.getElementById(fields[i]).checked)?"true":""; break; 
     91      if(HTMLArea.is_ie) 
     92        param[fields[i]] = (document.getElementById(fields[i]).checked)?true:""; 
     93      else 
     94        param[fields[i]] = (document.getElementById(fields[i]).checked)?fields[i].substring(2,20):""; 
     95      break; 
    9396    default: 
    9497      param[fields[i]] = document.getElementById(fields[i]).value; break; 
     
    149152  <div id="txt"> 
    150153    <div class="fr">Read Only</div> 
    151     <input type="checkbox" name="readonly" id="f_readonly" value="readonly" /> 
     154    <input type="checkbox" name="readOnly" id="f_readOnly" value="readOnly" /> 
    152155    <p /> 
    153156     
     
    159162      <div class="space"></div> 
    160163      <div class="fr">Max length:</div> 
    161       <input type="text" name="maxlength" id="f_maxlength" size="5"     title="Maximum number of characters accepted" /> 
     164      <input type="text" name="maxLength" id="f_maxLength" size="5"     title="Maximum number of characters accepted" /> 
    162165      <div class="space"></div> 
    163166          </fieldset> 
  • trunk/plugins/Forms/popups/select.html

    r239 r254  
    1818    case "f_multiple": 
    1919    case "f_disabled": 
    20       document.getElementById(fields[i]).checked = param[fields[i]] == "true"; break; 
     20      document.getElementById(fields[i]).checked = (param[fields[i]]==fields[i].substring(2,20)) || (param[fields[i]] == true); break; 
    2121    case "f_size": 
    2222      document.getElementById(fields[i]).value = (param[fields[i]]<=0)?"":param[fields[i]]; break; 
     
    4646        param["f_multiple"] = ""; 
    4747      else 
    48             param["f_multiple"] = (document.getElementById(fields[i]).checked)?"true":""; 
     48            param["f_multiple"] = (document.getElementById(fields[i]).checked)?"multiple":""; 
    4949            break; 
    5050    case "f_disabled": 
    51       param[fields[i]] = (document.getElementById(fields[i]).checked)?"true":""; break; 
     51      param[fields[i]] = (document.getElementById(fields[i]).checked)?"disabled":""; break; 
    5252    default: 
    5353      param[fields[i]] = document.getElementById(fields[i]).value; break; 
     
    163163    <p /> 
    164164    <div class="fr">Size:</div> 
    165     <input name="size" id="f_size" type="text" value="" size="15"> 
     165    <input name="size" id="f_size" type="text" value="" size="15" /> 
    166166    <p /> 
    167167                <div class="fr"><nobr>Multiple Select</nobr></div> 
    168     <input name="multiple" id="f_multiple" type="checkbox"> 
     168    <input name="multiple" id="f_multiple" type="checkbox" value="multiple" /> 
    169169    <p /> 
    170170    <div class="fr">Disabled</div> 
  • trunk/plugins/Forms/popups/textarea.html

    r239 r254  
    88<script type="text/javascript"> 
    99 
    10 var fields = ["f_name", "f_value", "f_cols", "f_rows", "f_wrap", "f_tabindex", "f_accesskey", "f_readonly", "f_disabled"]; 
     10var fields = ["f_name", "f_text", "f_cols", "f_rows", "f_wrap", "f_tabindex", "f_accesskey", "f_readOnly", "f_disabled"]; 
    1111 
    1212function Init() { 
    13   window.resizeTo(480,260); 
     13  window.resizeTo(280,260); 
    1414  __dlg_translate("Forms"); 
    1515        __dlg_init(); 
     
    1717  for (var i in fields) { 
    1818    switch (fields[i]) {  
    19     case "f_readonly":  
     19    case "f_readOnly": 
    2020    case "f_disabled": 
    21       document.getElementById(fields[i]).checked = param[fields[i]]=="true"; break; 
     21      document.getElementById(fields[i]).checked = (param[fields[i]]==fields[i].substring(2,20)) || (param[fields[i]] == true); break; 
    2222    default: 
    2323      document.getElementById(fields[i]).value = param[fields[i]]; break; 
     
    3838  for (var i in fields) { 
    3939    switch (fields[i]) {  
    40     case "f_readonly":  
     40    case "f_readOnly": 
    4141    case "f_disabled": 
    42       param[fields[i]] = (document.getElementById(fields[i]).checked)?"true":""; break; 
     42      if(HTMLArea.is_ie) 
     43        param[fields[i]] = (document.getElementById(fields[i]).checked)?true:""; 
     44      else 
     45        param[fields[i]] = (document.getElementById(fields[i]).checked)?fields[i].substring(2,20):""; 
     46      break; 
    4347    default: 
    4448      param[fields[i]] = document.getElementById(fields[i]).value; break; 
     
    8690  <p /> 
    8791  <div class="fr">Read Only</div> 
    88   <input type="checkbox" name="readonly" id="f_readonly" value="readonly" /> 
     92  <input type="checkbox" name="readOnly" id="f_readOnly" value="readOnly" /> 
    8993  <p /> 
    9094  <div class="fr">Disabled</div> 
     
    99103   
    100104  <div class="fr">Initial Text:</div> 
    101   <input type="text" name="value" id="f_value" title="Default text (optional)" /> 
     105  <input type="text" name="text" id="f_text" title="Default text (optional)" /> 
    102106  <div id="buttons"> 
    103107    <button type="button" name="ok" onclick="return onOK();">OK</button> 
Note: See TracChangeset for help on using the changeset viewer.