PDA

View Full Version : Add button to Newreply...


Boofo
07-24-2002, 12:12 PM
I'm having trouble getting the code right to add a button to the vbCode in the newreply template. I want to add a button like the quote button but this one will insert a space into the message. Here's what I have so far but it is not working. Can someone please help steer me in the right direction with this?

In vbcode_language.js find

----------
quote_text = "Insert a quote into your message";
----------

After that add

----------
space_text = "Insert a SPACE into your message";
----------

In vbcode_buttons template find

----------
<input type="button" class="bginput" value="PHP" title="PHP CODE" onclick="vbcode(this.form,'PHP','')" onmouseover="stat('php')">
----------

After that add

----------
<input type="button" class="bginput" value="SPACE" title="Insert a Space" onclick="vbcode(this.form,'&nbsp;','')" onmouseover="stat('space')">

bad_madman
07-25-2002, 03:38 PM
Use the Smiley javascript code for this :bandit: *fg

replace your line
<input type="button" class="bginput" value="SPACE" title="Insert a Space" onclick="vbcode(this.form,'&nbsp;','')" onmouseover="stat('space')">
with:
<input type="button" class="bginput" value="SPACE" title="Insert a Space" onclick="javascript:smilie('& nbsp;')" onmouseover="stat('space')">
or with this:
<input type="button" class="bginput" value="SPACE" title="Insert a Space" onclick="javascript:document.vbform.message.value+='& nbsp;';document.vbform.message.focus();" onmouseover="stat('space')">

Note: & nbsp; -> without blank (between & and nbsp; )