Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:create:functions:buttoncode [04.01.2015 14:29]
alexander.ritter [Tips]
en:create:functions:buttoncode [25.08.2020 11:24] (current)
sophia.schauer [Example: Use with Placeholders]
Line 9: Line 9:
     * ''%%'next'%%'' -- Next button     * ''%%'next'%%'' -- Next button
     * ''%%'back'%%'' -- Back button     * ''%%'back'%%'' -- Back button
 +    * ''%%'break'%%'' -- Button to interrupt the interview
 +    * ''%%'leave'%%'' -- Button to cancel and delete data
  
  
Line 18: Line 20:
  
 **Tip:** If you want to reposition the buttons in general, modify the questionnaire layout and use the placeholders ''%button.next%'' and ''%button.back%'' in the HTML template of the layout, as described in the guide to [[:en:create:layout|Questionnaire Layouts]]. **Tip:** If you want to reposition the buttons in general, modify the questionnaire layout and use the placeholders ''%button.next%'' and ''%button.back%'' in the HTML template of the layout, as described in the guide to [[:en:create:layout|Questionnaire Layouts]].
 +
 +===== Example: Next button in the middle of the questionnaire page =====
 +
 +<code php>
 +html(
 +  '<div style="margin: 4em; text-align: center">'.
 +  buttonCode('next').
 +  '</div>'
 +);
 +</code>
 +
  
 ===== Example: Insert Directly in HTML Code ===== ===== Example: Insert Directly in HTML Code =====
Line 52: Line 65:
 $buttonNext = buttonCode('next');  // Saves the HTML code for the  $buttonNext = buttonCode('next');  // Saves the HTML code for the 
 $buttonBack = buttonCode('back');  // buttons in two variables $buttonBack = buttonCode('back');  // buttons in two variables
-replace('%btnNext%', $buttonNext);  // Store for placeholders +replace('%btnNext%', $buttonNext, 'html');  // Store for placeholders 
-replace('%btnBack%', $buttonBack);+replace('%btnBack%', $buttonBack, 'html');
 text('buttons');  // display text in the questionnaire text('buttons');  // display text in the questionnaire
 </code> </code>
en/create/functions/buttoncode.1420378177.txt.gz · Last modified: 04.01.2015 14:29 by alexander.ritter
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki