Join Now

Click here to join our
growing community:



Welcome Tour
Pro Modules

Copyright © 2020
Terms of Use
Privacy Policy



For security reasons, you cannot insert javascript directly into pages by simply cut and paste methods. Rather, BoltWire offers a couple secure work arounds.

Code JS

BoltWire has a special page in the default installation which allows you to set up your own one line javascript commands (set up as info vars). To use one of these in your page, simply call js=field in either a form or link.

Here are some examples using some of the default javascript snippets. For a full list, take a look at code.js.

Use this to call up the print dialog (link or button)

[button PRINT js=print]

Clears a form value on focus:

[text field 'Click here...' js=clear]

Turns a select box into a page changer

[select jump js=jump]
[option '' 'Choose One']
[option {script}main Welcome]
[option {script}downloads Download]
[option {script}docs Documentation]
[option {script}extend Extensions]
[option {script}support Support]



Here's how you send an alert. Notice how the parameter is sent through.

[[|CLICK HERE|js='alert::Hello {id}!']]

Use js=back to return the user to the last page they viewed (equivalent to hitting the back button).

Here's how to skip from one input to another. Click in box 1, then hit tab:

[text one js=skip::three]
[text two]
[text three]



You can add as many of these short little js snippets as you like.

Note: You can also define a js snippet in config.php. To define js=clear above, I could have done the same thing with this line:

$BOLTformJs['clear'] = "onFocus=this.value=''";

This may be useful if you only want to define snippets for certain pages, or for certain plugins.


To insert a longer bit of javascript code, see the embed function. You can also combine these two approaches. Define a function in some code.embed page, and then add a line to code.js with some code to call that function.

Because javascript is a significant security risk, you should always keep your code pages carefully protected.