I am selecting a text on textarea and replacing it with newtext “shan”..The problem when I click on the submit button still the old text is submitted instead of new text..
But this problem doesn’t come when I press spacebar on keyboard and then press Submit button..
I can see the replaced text in “TextArea” but when I submit it the only the old text gets submitted..
var replacement text="shan";
if (window.getSelection) {
sel = window.getSelection();
if (sel.rangeCount) {
range = sel.getRangeAt(0);
var e1=range.startContainer;
var e2=e1.getElementsByTagName('textarea');
e2[0].value=replacementText;
e1.focus();
}
}
Syntax Error?
Other things to look at or update your question with…
How are you submitting the form?
Do you have the textarea named appropriately so that it will get sent back to the server properly? Are you getting the value out properly via javascript(if thats how you are posting back)?
Have you checked the post info with Fiddler or Firebug or Chrome to see what the request actually looks like?