vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Placeholder for Text Areas ? (https://vborg.vbsupport.ru/showthread.php?t=322120)

dimebag.d 03-15-2016 11:28 AM

Placeholder for Text Areas ?
 
Hi guys.
I am trying add a default text to quick reply and post area but i cant.

http://i.imgur.com/fmiPOmC.jpg
and
http://i.imgur.com/8dqHF94.jpg

So how can i do these? Thanks.

*i am using vb 4.2.1

MarkFL 03-15-2016 02:24 PM

Are you trying to add a field where your users can enter text, or do you want some default text to already appear in the post message area when the form is loaded?

dimebag.d 03-15-2016 09:42 PM

Quote:

Originally Posted by MarkFL (Post 2567272)
do you want some default text to already appear in the post message area when the form is loaded?

Yes.Like this;
http://www.w3schools.com/tags/tryit....ut_placeholder

How can i do that?

MarkFL 03-15-2016 10:11 PM

Ah, okay now I know exactly what you mean. :)

It is likely possible for the standard editor, but it may not be possible for the WYSIWYG editor. I will look into it very soon, and post back what I find. ;)

--------------- Added [DATE]1458100198[/DATE] at [TIME]1458100198[/TIME] ---------------

As I suspected, it won't work with the WYSIWYG editor (it is an inline document), but for the Standard editor you can use the following plugin:

Product: vBulletin

Hook Location: parse_templates

Title: Give Standard Editor Textarea A Placeholder

Execution Order: 5

Plugin PHP Code:

PHP Code:

if (in_array(THIS_SCRIPT, array('showthread''newreply''newthread')))
$template_hook['footer_javascript'] .= '<script>
window.onload = function(){
    var el = document.getElementsByClassName("cke_source");
    el[el.length - 1].placeholder = "Enter Post Here...";
};
</script>'


Plugin is Active: Yes

Click "Save".

dimebag.d 03-16-2016 12:29 PM

Hey Mark! Thanks man, its working perfectly :)

https://vborg.vbsupport.ru/external/2016/03/7.jpg

Stratis 03-17-2016 05:38 PM

Mark, can you please tell if I can include color code and image code
in the above Hook? if I can how?

Thank you in advanced.

MarkFL 03-17-2016 06:25 PM

Hey Stratis,

What do you mean by including color/image code?

Stratis 03-17-2016 06:40 PM

Lets say that i want to change the color of the text "Enter Post Here..."
or place an image to show instead of text.


:)

MarkFL 03-17-2016 06:48 PM

It is possible to use (browser-specific) CSS to change the color of the placeholder text, but I don't think you can use an image as a placeholder. :)

Stratis 03-17-2016 06:54 PM

Ok thanks for the answer Mark.


All times are GMT. The time now is 09:17 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01033 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete