Jump to content
xisto Community

clovis818

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. i need some help i want to create a thing where when some one double clicks a certain text it changes into a texbox where they can edit the text and the they double click and it changes into the test they just typed in. I have found this function in javascript that does some of it but i needs to be simplified <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://forums.xisto.com/no_longer_exists/ to Text Box - Demo - DOM</title><script type="text/javascript">/* © John Davenport Scheuer */function exchange(el){var nodeI=el.parentNode, inputC=document.createElement('input'), text=el.innerHTML;el.style.font='.9em "ms sans serif", "sans"'el.innerHTML+='\x20'with (inputC){setAttribute('value', text, 0)setAttribute('size', text.length-1, 0)style.width=document.all&&!window.opera? el.offsetWidth-2+'px' : el.offsetWidth+2+'px'setAttribute('type', 'text', 0)setAttribute('id', el.id, 0)}nodeI.replaceChild(inputC, el)}</script></head><body><span id="itm1" onclick="exchange(this)">House</span><br><span id="itm2" onclick="exchange(this)">SpantoTextBox-Demo</span><br><span id="itm3" onclick="exchange(this)">Span to Text Box - Demo exchange(this)</span><br><input id="itm4" type="text" value="Existing Text Box"><br><span id="itm5" onclick="exchange(this)">In Line Test</span><span id="itm6" onclick="exchange(this)">In Line Test Too</span><span id="itm7" onclick="exchange(this)">In Line Test Also</span></body></html> If its possible to have it in php or javascript please
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.