Reputation: 5534
I tried the following, and it shows an empty text area, the value isn't displayed:
<input type="textarea" class="class1" name="name1" placeholder="<?= $val1?>" />
Any thoughts on what should be done so it will work?
Update: It is now working, the value was empty, therefore text area didn't show anything. The code can be used safely.
Upvotes: 1
Views: 23630
Reputation: 3608
if $val1
is not null, i think the problem is short tag (<?= ?>
).
You can override this config, at the top of file, put this line to enable short tag:
ini_set('short_open_tag',1);
Upvotes: 3
Reputation: 162801
Make sure that $val1
actually contains a non-empty value. If it does, your code should create a non-empty placeholder
attribute.
Upvotes: 2
Reputation: 5534
Check whether the variable is empty (as @Asaph suggested in his comment). Entered a value and now it is working just fine.
Upvotes: 0
Reputation: 5547
<input type="textarea" class="class1" name="name1" placeholder="<?php echo $val1; ?>" />
There is no such input type
attribute as textarea
.
Do you mean:
<textarea class="class1" name="name1" placeholder="<?php echo $val1; ?>"></textarea>
Upvotes: 3