views:

46

answers:

3

Hi while I am performing the edit function .. i have a textarea where i type some text and submit

<tr align="left"> 
            <td  class="table_label">Reason </td>
            <td><textarea cols="17" class="text_box_login_14_width_150"  size="5" name="txtReason" id="txtReason"></textarea></td>
        </tr>

when i submit i must receive the value in the edit form

<td>
                <textarea id="txtReason"  name="txtReason" value="<?= $row['dReason']?>"></textarea>
            </td>

but i dont receive the value for text area how to receive the value

+2  A: 

<textarea><?php echo $row['dReason']; ?></textarea>

binaryLV
A: 

Unlike <input type="text">, we write the value of textarea between opening and closing tag, rather than specifying in value attribute

<textarea id="txtReason"  name="txtReason">
<?= $row['dReason']?>
</textarea>
nik
It's not a good idea to have newlines there, i.e., it should be written in single row. Otherwise contents of `textarea` might have some whitepsace characters that are not present in value that is outputed by PHP.
binaryLV
just did it to look clean
nik
+2  A: 

For text area the value must be between the start and end of textarea tags

udaya