开发者

Need Removable comments in this textarea

Hi I need to add some content which would be clear on click in the given bel开发者_高级运维ow textarea.

Not able to find the answer, please help me

  <tr><td><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td></tr>


If I understand you properly, you want to display some text in your textarea, which will disappear when user moves focus to that textarea.

If you're using html5 it will be a simple task - just add a placeholder attribute to your textarea. I do not know what kind of php sript/framework are you using, but it should look like this:

<textarea placeholder="Click me to type something"></textarea>

If not, you should use javascript to achieve this result. There are lots of available solutions, for example:

jQuery Placeholder

EDIT: I checked how the tep_draw_textarea_field function works, for html5 code you should use:

<?php echo tep_draw_textarea_field('comments', 'soft', '60', '5', '', 'placeholder="Click me"'); ?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜