BoltWire

Innovative Ideas :: Radical Results!

INFORMATION

DOCUMENTATION

SOLUTIONS

Buttons (Multiple)

Documentation > Forms > Buttons (Multiple)

Here's a simple little script that demonstrates how to use the conditional feature to process multiple buttons. In this case you have several buttons, each triggering a different message. But you could use this technique to trigger any BoltWire command.


TRY THE CODE: <code> [form] [session if_1 "equal '{=submit}' 'MSG 1' ? msg=Hey you clicked the first button."] [session if_2 "equal '{=submit}' 'MSG 2' ? msg=So why did you pick the button in the middle?"] [session if_3 "equal '{=submit}' 'MSG 3' ? msg=Had to see what the last message was, eh?"] [session msg "hello {=submit}"] [form] </code>

Comment by member.drunkenmonk?, posted Tue Mar 31 09:23:28 2009
This is very useful, but there are cases where I want more than one thing to happen if a button is pushed.

For example: I sometimes want to save data to 3 pages, page_1, page_2, page_3 if on button is pushed, but only two pages, page_4 and page_5 if another button is pushed.

Is there a recommended way to implement this? Personally, I can think of no way without letting the button forward you to custom script pages which then return you, which is annoying.

Copyright © 2013, all rights reserved.