2

check these lines please

<textarea class="wideInput" cols="30" rows="10" value="<?php echo $row['foodDescription']; ?>" ></textarea>
            <input value="<?php echo $row['foodDescription']; ?>" />

the input type has the default value, but the textarea doesn't , why please , what is the solution?

henser
  • 3,307
  • 2
  • 36
  • 47
Marco Dinatsoli
  • 10,322
  • 37
  • 139
  • 253

7 Answers7

9

There is no value attribute

<textarea class="wideInput" cols="30" rows="10" ><?php echo $row['foodDescription']; ?></textarea>
Alan Whitelaw
  • 16,171
  • 9
  • 34
  • 51
2

You can add value in between <textarea> starting and ending tag.

<textarea class="wideInput" cols="30" rows="10"><?php echo $row['foodDescription']; ?></textarea>
Dipesh Parmar
  • 27,090
  • 8
  • 61
  • 90
2
<textarea class="wideInput" cols="30" rows="10" value="<?php echo $row['foodDescription']; ?>" ></textarea>

should be changed to:

<textarea class="wideInput" cols="30" rows="10"><?php echo $row['foodDescription']; ?></textarea>

because textarea doesn't have value attribute

2

Simply put the value in between the textarea tags:

<textarea class="wideInput" cols="30" rows="10">
    <?php echo $row['foodDescription']; ?>
</textarea>
jlasarte
  • 623
  • 8
  • 28
2

A textarea isn't like an input, it can't be self-closed (<textarea/>), it is self closing tags that can have a value to default display. Just change your code to echo the foodDescription inside the <textarea></textarea> tags

Andy
  • 14,427
  • 3
  • 52
  • 76
2

You have to put the default value between the tags so:

<textarea class="wideInput" cols="30" rows="10"><?php echo $row['foodDescription']; ?></textarea>
0

It has to be in-between the tags.

<textarea class="wideInput" cols="30" rows="10"><?php echo $row['foodDescription']; ?></textarea>

Lol preaching to the choir