CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Location
    Poland
    Posts
    278

    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>&nbsp;&nbsp;</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

  2. #2
    Join Date
    May 2006
    Location
    Dresden, Germany
    Posts
    458

    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
  •  





Click Here to Expand Forum to Full Width

Featured