Join Now

Click here to join our
growing community:

JOIN LOGIN



Docs

Welcome Tour
Handbook
      Markups
      Variables
      Conditions
      Functions
      Forms
      Commands
      Concepts
Extensions
Pro Modules
Developers



Copyright © 2020
Terms of Use
Privacy Policy
BoltWire

Handbook

Nextpage

This command is used to forward the user to the appropriate next page once the form processing is complete.

If not set in the form, or set to a null value, it will default to the current page. If you are calling an action, that will mean returning to the underlying page, not the action page.

If a form aborts for some reason, the browser will NOT advance to the next page, but reload the form. This is usually the desired behavior, but you could use an abort conditional and a forwarding function if desired. For example:

[form]
Enter some text: [text field required=true] [submit]
[command nextpage some.page]
[form]

[if abort]<(forward error.page)>[if]

If a user enters content and hits submit, they are forwarded to some.page. If they try to submit the form with no content, the form aborts when it sees required=true, and the page is reloaded. The abort conditional sees that the form submission failed, and the user is forwarded to the error page.

You can set the nextpage variable dynamically using a method like this:

[form]
Choose: [radio to page.1] Page 1   [radio page.2] Page 2   [radio page.3] Page 3
[submit]
[command nextpage {=to}]
[form]

Nextpage can use local page names like some.page or full URL's like http://www.google.com. It also takes page shortcuts. For a full discussion of the page shortcuts available in BoltWire, please see the tutorial.

Note: To use nextpage to forward a person out of your site, it must include http:. If you jus use www.google.com will be interpreted as a page name.

If nextpage is called with a null value, it leaves the current nextpage as it is. Consider for example the following form:

[form]
Choose: [radio to page.1] Page 1   [radio page.2] Page 2   [radio page.3] Page 3
[submit]
[command nextpage error.page]
[command nextpage {=to}]
[form]

If no value is selected, the form forwards to the error page. If a value is selected, that overwrites the nextpage value, and it goes to the page selected.

Auto Jump

BoltWire has a small number of javascript snippets built into it, and you can always add more. One of them is called jump. Here's is an example of how to use it:

[form]
[select jump js=jump]
[option '{script}{p}' 'Select a Page']
[option {script}page.1 'Page 1']
[option {script}page.2 'Page 2']
[option {script}page.3 'Page 3']
[select]
[form]

You could even populate the list of pages dynamically using a search or list function. Here's an example:

[form]
[select jump js=jump]
[option '{script}{p}' 'Select a Page']
[(search group=test template="[option {script}{+p} '{{+p}:title}']" count=false)]
[select]
[form]

Note: This script does not use nextpage, but rather javascript to advance to the next page. You don't even need to click a button to submit the form!