mazhar  khan

mazhar khan

  • 1.6k
  • 148
  • 4.2k

How to pass values to 3 text area..

May 7 2015 1:39 AM
i am unable to pass values to one text but remains to text area to pass values using javascript.
 
 
java script code:
 
 <script type="text/javascript">

window.onload = function () {

tinymce.init({
selector: 'textarea',

menubar: false,
scrollbar:false,
toolbar: 'bold italic underline | alignleft aligncenter alignright ',
width: 800,
height:250,
setup: function (ed) {
ed.on('keyup', function (e) {
var count = CountCharacters();
document.getElementById("character_count").innerHTML = "Characters: " + count;
var theIframe = document.getElementById('txtTinyMCE');
theIframe.setAttribute('scrolling', 'no');
theIframe.style.width = '200px';
theIframe.style.height = '100px';

});
}
});


}
function CountCharacters() {
var body = tinymce.get("txtTinyMCE").getBody();
var content = tinymce.trim(body.innerText || body.textContent);
return content.length;
};
function ValidateCharacterLength() {
var max = 3000;
var count = CountCharacters();
if (count > max) {
// alert("Maximum " + max + " characters allowed.")
document.getElementById('errfn').innerHTML = "Maximum " + max + " characters allowed.";

return false;
}
else if
(count == 0)
{
// alert("Please Enter some words");
document.getElementById('errfn').innerHTML = "Please Enter some words";

return false;
}
return;
}


</script> 
 
 Aspx design:
 
 
  <textarea id="txtTinyMCE" rows="4" runat="server" cols="20"></textarea> <span id="errfn" style="color:red"></span>

  <textarea id="txtTinyMCE1" rows="4" runat="server" cols="20"></textarea> <br />

  <textarea id="txtTinyMCE2" rows="4" runat="server" cols="20"></textarea> <br />



<asp:Button ID="Button1" runat="server" onclick="Button1_Click" OnClientClick="return ValidateCharacterLength();" Text="Button" ValidationGroup="pass" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Answers (1)