This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
button [2014/06/15 19:20] l [Usage] |
button [2014/06/15 20:11] l [Usage] |
||
---|---|---|---|
Line 1: | Line 1: | ||
=====<<button>>===== | =====<<button>>===== | ||
- | The <<button>> macro creates a button that, when clicked, sets the data entered into other form macros in the passage ([[<<textinput>>]], [[<<radio>>]], [[<<checkbox>>]]), and moves to another passage. | + | The **<<button>>** [[macro]] creates a button that, when clicked, sets the data entered into other form macros in the passage ([[<<textinput>>]], [[<<radio>>]], [[<<checkbox>>]]), and moves to another passage. |
====Usage==== | ====Usage==== | ||
- | The <<button>> macro should be provided with a link: | + | The <<button>> macro should be provided with a link in a string: |
- | >%%<<%%button %%[[%%//displayed text//|//passage name//%%]]>>%% | + | >%%<<%%button %%"[[%%//displayed text//|//passage name//%%]]">>%% |
The resulting button behaves identically to the link, but, when clicked, additionally causes the data entered into [[<<textinput>>]], [[<<radio>>]] and [[<<checkbox>>]] macros to be placed in the [[variable]]s. | The resulting button behaves identically to the link, but, when clicked, additionally causes the data entered into [[<<textinput>>]], [[<<radio>>]] and [[<<checkbox>>]] macros to be placed in the [[variable]]s. | ||
For instance, if the macro ''<<textinput $FoodName>>'' appears in the same passage with a <<button>>, and the text "pretzels" has been entered into the input box, then clicking the button will, in addition to changing passages, run the equivalent of ''<<set $FoodName to "pretzels">>''. | For instance, if the macro ''<<textinput $FoodName>>'' appears in the same passage with a <<button>>, and the text "pretzels" has been entered into the input box, then clicking the button will, in addition to changing passages, run the equivalent of ''<<set $FoodName to "pretzels">>''. |