-
October 21st, 2011, 02:21 AM
#1
Insert text into texarea field
Hallo Everybody
My question is:
Is there any way to insert text (which comes from another table) into <textarea> field.
I can manage the situation when insted of <textarea> field I have simple
Code:
<td><span id="description"></span> </td>
and to fill the description field I do as follows:
Code:
$['description'].innerHTML='<?php $descr_comes_from_template_table; ?>'
I works ok, but ofcourse I am not able to edit just entered description text.
Could you suggest me another way how to implement my case by ajax technology.
to sum up
I need fill in a <textarea> filed with text which comes from another table.
After filling the <textarea> an users should be able to modify just filled template text.
Thanks in advance
Andrzej
-
November 15th, 2011, 08:11 AM
#2
Re: Insert text into texarea field
Using jqery you can do it the following way:
The ajax call should look something like this:
Code:
$.ajax({
type: "POST",
url: "http://www.yourserver/your_php_file.php",
data: "data1=whatever&data2=whateverelse",
}).done(function( msg ) {
$('#id_of_textarea').text($('#id_of_textarea').text() + msg);
});
Inside your php file you simply return via "echo" waht you want to fill in.
Regards
PA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|