User Tools

Site Tools


twine1:button

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
twine1:button [2017/08/23 17:48]
videlais created
twine1:button [2017/10/10 00:39] (current)
Line 1: Line 1:
-====== <<​button>> ​======+=====<<​button>>​=====
  
-<<​button>> ​create ​HTML button. When clicked, the string used as a parameter will be the passage to transition to after the click.+The **<<​button>>​** [[macro]] creates ​a button, a special type of [[link]] that, when clicked, ​sets the data entered into other form macros in the passage ​([[twine1:​textinput | <<​textinput>>​]],​ [[twine1:​radio | <<​radio>>​]],​ [[twine1:​radio | <<​checkbox>>​]]),​ and moves to another passage.
  
-<code+====Usage==== 
-<<​button ​"​Test"​>> + 
-</code>+The <<button>> macro should be provided with the familiar link syntax: 
 + 
 +>%%<<%%button ​%%[[%%//​displayed text//​|//​passage name//%%]]>>%% 
 + 
 +The resulting button behaves identically to a normal 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">​>''​.
twine1/button.1503510512.txt.gz · Last modified: 2017/10/10 00:38 (external edit)