Add a simple colour listbox to post.php

From PunBB Resource Wiki

Jump to: navigation, search

What it does

This small mod adds a little drop-down menu above your post in post.php that allows you to insert colours.

What to do

?>
						<script type="text/javascript">
						function addColour(col)
						{
							frm = document.getElementById('post');
							frm.req_message.value = frm.req_message.value + "[color=#" + col + "][/color]";
						}
						</script>
						<label>Insert a colour: 
						<select name="cpicker" id="cpicker" onchange="addColour(this.value)">
							<option value="FF0000">Red</option>
							<option value="00FF00">Green</option>
							<option value="0000FF">Blue</option>
							<option value="000000">Black</option>
							<option value="FFFFFF">White</option>
							<option value="FFFF00">Yellow</option>
							<option value="808080">Grey</option>
						</select>
						</label>
<?php
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox