Style
With foreach iteration we can write the _option commands of _select in short.
WMLHeader styles.wml
proc InputInfo {} {
_p
quote "Prefix:"
_select "title='Prefix' name='prefix'"
set ls {"Mr." "Mrs." "Ms"}
foreach e $ls {
_option "value='$e'"
quote "$e"
option_
}
select_
input first name to fname and last name to lname.
quote "First Name:"
__input "title='First' name='fname'"
quote "Last Name:"
__input "title='Last' name='lname'"
p_
}
template specifies the reactions for all the cards in a deck.
_wml
_template
_do "type='accept' label='Done'"
__go "href='#end'"
do_
template_
the _do type in a card will override the same _do type in the template.
_card _do "type='accept' label='Next'"
__go "href='#c1'"
do_
onpick specifies the hyperlink of a selection.
_p "mode='nowrap'"
quote "[_b_ Styles]"
_select
_option "onpick='#c1'"
quote "Unordered"
option_
_option "onpick='#c2'"
quote "Ordered"
option_
select_
p_
card_
c1 is an unordered card and c2 is ordered card.
# unordered card
_card "id='c1' title='Employee' ordered='false'"
InputInfo
card_
# ordered card
_card "id='c2' title='Employer' ordered='true'"
InputInfo
card_
'options' key clears all the variables.
_card "id='end'"
_do "type='options' label='Clear'"
_refresh
__setvar "name='prefix' value=''"
__setvar "name='fname' value=''"
__setvar "name='lname' value=''"
refresh_
do_
display variables $prefix, $fname, and $lname.
_p "align='center'"
quote "Welcome!"
__br
quote {$prefix $fname $lname}
p_
card_
wml_
|