MyBB Community Forums

Full Version: A link opens when i click on a text field
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi.

I was adding a awesome effect to my board today. 

<script type="text/javascript"> 
    images = new Array(5);  
      
    images[0] = "<a href='https://www.youtube.com/v/hBXLT7VZsHM' target='_blank'><img src='images/derp/troll.png' </a>";  
      
    images[1] = "<a href='https://www.youtube.com/v/biGhzgNxpAA' target='_blank'><img src='images/derp/wtf.png' </a>";  
      
    images[2] = "<a href='https://www.youtube.com/v/1M5zHy6YDIE' target='_blank'><img src='images/derp/fms.png' </a>";  
      
    images[3] = "<a href='https://www.youtube.com/v/jfXwBFfJQPM' target='_blank'><img src='images/derp/werp.png' </a>";  
      
    images[4] = "<a href='https://www.youtube.com/v/slLGniM_mJA' target='_blank'><img src='images/derp/tip.png' </a>";  
      
    index = Math.floor(Math.random() * images.length);  
      
    document.write(images[index]);  
      

      
    </script>
I was idding this to my header_welcomeblock_guest template, and now the youtube link appears when you click in the username and password input field. I can't figure it out, you can see the fields here:
<ul>

				<li><span class="log"><i class="fa fa-user fa-fw"></i></span><input name="quick_username" id="quick_login_username" type="text" value="Username" class="textlog" size="25" /></li>
				<li><span class="log"><i class="fa fa-lock fa-fw"></i></span><input name="quick_password" id="quick_login_password" type="password" value="Password" class="textlog" size="25" /></li>
			</ul>
There is a way to quick way to fix this but it would involve a plugin, and conditionals, and placing the login box on another template then hiding it from logged in members.I hope someone can come up with a better solutions, good luck
noone?
image tag should be like <img src='images/derp/name.png' />

example:
images[0] = "<a href='https://www.youtube.com/v/hBXLT7VZsHM' target='_blank'><img src='images/derp/troll.png' /> </a>";  
How blind can i be.. Im sorry for waisting your time on this, how epic! Lol.. And i should be a programmer.. Have a nice weekend :-D