Društvo LJUDMILA
Rozmanova ulica 12
1000 Ljubljana
Slovenia
Prostori: osmo/za

WDBI (Javascript)

Name

WDBI (Javascript) - a Javascript library for creating forms on a website

Synopsys

wdbi.push();
wdbi.form('users');
wdbi.display_form();
wdbi.pop();
wdbi.form('users').display()
wdbi.info();

Pieces of code

TD editor

try   { document.removeEventListener('click',handler,true); } catch(e){}
handler = function (e)  {
  if (e.target.tagName == 'TD' )
  {
      inp = document.createElement('input');
      inp.value = e.target.innerHTML;
      inp.style.width = "100%";
      inp.style.height = "100%";
      inp.style.padding = "0";
      inp.style.margin = "-1px";
      inp.style.border = "solid 1px silver";
      
      inp.onblur= function () {
         e.target.innerHTML = inp.value
      };
      inp.style.textAlign= window.getComputedStyle(e.target, "").getPropertyValue('text-align');

      

      e.target.innerHTML='';
      e.target.appendChild(inp);
      inp.focus();
  }
};
document.addEventListener('click',handler,true);