MyBB Community Forums

Full Version: Make Input Text Disappear in Login Box and Video Dropdown
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there  a way to make the text in login boxes and video choices disappear when you click inside the input boxes?

Or, failing that, where can I just remove the default text in the login boxes and video down input?
Ok, I found the answer to the code part of this.

For the login you can edit header_welcomeblock_guest in headertemplates of your template.

For the login bit you can change value="Name" (or whatever you have between the "") to:

value="Name" onfocus="if (this.value=='Name') this.value='';"

and same for value="Password" i.e.:

value="Password" onfocus="if (this.value=='Password') this.value='';"

Just need to find where the template for adding video code is now.
You shouldn't use value, what you want is a placeholder. You can set a placeholder using the placeholder attribute, for example:

<input type="text" name="name" placeholder="Your full name">
Ok, thank you. I will change to that instead. Do you know where I can edit the video embed choices box?

Ok, I found where to edit the video choices dropdown box, you have to actually edit the file on the server called bbcodes_sceditor.js in the folder jscripts - here I was able to swap value="http://" for placeholder="http://" and now it disappears when you enter something, great!

I was also able to change the order of the video dropdowns in the same file so that youtube and vimeo are at the top, with youtube, being the most popular, being the default which makes much more sense.
(2015-10-04, 04:36 PM)Astroman Wrote: [ -> ]Ok, thank you. I will change to that instead. Do you know where I can edit the video embed choices box?

Ok, I found where to edit the video choices dropdown box, you have to actually edit the file on the server called bbcodes_sceditor.js in the folder jscripts - here I was able to swap value="http://" for placeholder="http://" and now it disappears when you enter something, great!

I was also able to change the order of the video dropdowns in the same file so that youtube and vimeo are at the top, with youtube, being the most popular, being the default which makes much more sense.

The code in the file called bbcodes_sceditor.js has changed when upgraded to version 1.8.21 and I can't find where to put "placeholder="http://". Does anyone know where to find it?

Even the code where I changed "<option value="youtube">" to "<option value="youtube" selected>" has changed and I can't find where to make this change either.