djp1988 Posted August 16, 2008 Share Posted August 16, 2008 How to do?I tried (the id being a button, sibling to the textarea): function savetheinfo(id){ txtarea = id.parentNode.getElementsByTagName("textarea"); for(ta=0;ta<txtarea.length;ta++){ if(txtarea[ta].getAttribute("name") == "textarea"){ newCom = txtarea[ta].innerHTML; alert(newCom); txtarea[ta].parentNode.innerHTML = newCom; } } } But that only return the original innerHTML of the text area, because earlier I did this: theTxt[t].innerHTML = '<textarea name="textarea" cols="50" rows="4">'+textToEdit+'</textarea><input onclick="savetheinfo(this)" type="submit" name="Submit" value="Save" />'; "textToEdit" being the original text that I want to allow people to edit, so I can't find a way to get the edited text of the textarea Link to comment Share on other sites More sharing options...
djp1988 Posted August 16, 2008 Author Share Posted August 16, 2008 maybe newCom = txtarea[ta].innerHTML; Yes that's it, I seem to be most able to undetstand my problems only when I think of what other members could be thinking and typing... strange Link to comment Share on other sites More sharing options...
jeffman Posted August 16, 2008 Share Posted August 16, 2008 The intended way is this: txtarea[ta].value; Link to comment Share on other sites More sharing options...
djp1988 Posted August 16, 2008 Author Share Posted August 16, 2008 oh yes, slilly me I pasted the wrong line Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.