this could be a long shot but I am stuck with this code atm. I don't know anything about javascript but i have found myself trying to edit it. I want to create a textarea with a name.
I got this sample script that does the job perfectly but it is just missing a name for the textarea. This is just a bit of it:
The output of which in HTML is just <textarea></textarea> That's basically it. I need to change the script to create something like <textarea name="text"></textarea>
I have tried adding lines such as this in but I have yet to get any results!...
I have been searching online all night for a solution so it would be nice to get it wrapped up! Thanks for any help.
I got this sample script that does the job perfectly but it is just missing a name for the textarea. This is just a bit of it:
Code:
function catchIt(e) {
if (editing) return;
if (!document.getElementById || !document.createElement) return;
if (!e) var obj = window.event.srcElement;
else var obj = e.target;
while (obj.nodeType != 1) {
obj = obj.parentNode;
}
if (obj.tagName == 'TEXTAREA' || obj.tagName == 'A') return;
while (obj.nodeName != 'P' && obj.nodeName != 'HTML') {
obj = obj.parentNode;
}
if (obj.nodeName == 'HTML') return;
var x = obj.innerHTML;
var y = document.createElement('textarea');
// y.appendChild(document.createTextNode(x));
var z = obj.parentNode;
z.insertBefore(y,obj);
z.insertBefore(butt,obj);
z.removeChild(obj);
y.value = x;
y.focus();
editing = true;
return false;
}
The output of which in HTML is just <textarea></textarea> That's basically it. I need to change the script to create something like <textarea name="text"></textarea>
I have tried adding lines such as this in but I have yet to get any results!...
Code:
f.appendChild(document.name(text));
I have been searching online all night for a solution so it would be nice to get it wrapped up! Thanks for any help.