dropdown.callback

description

Will execute the command(s) whenever an option is selected from the drop-down list.

syntax

getDropDown(ELEMENT_NAME).callback(command)
  • command :

alternate(s)

  • getDropDown(ELEMENT_NAME).callback( command1, command2 )

since

PennController 1.5

example(s)


@newText("The weather is")
@    .after( newDropDown("temp","...").add("cold","warm","hot") )
@    .after( newText("implicature", "implies that the weather is ...") )
@    .print()
@,
@getDropDown("temp")
@$   .callback(
$        getDropDown("temp")
$            .test.selected("warm").success( 
$                getText("implicature").text("implicates that the weather is not hot") 
$            )
$            .test.selected("hot").success( 
$                getText("implicature").text("implies that the weather is not cold") 
$            )
$            .test.selected("cold").success( 
$                getText("implicature").text("implies that the weather is not even warm") 
$            )
@    )
  • Prints The weather is … implies that the weather is … onto the page, where the first occurrence of is a drop-down list containing the options cold, warm and hot. Upon selection of the option, the continuation will be modified accordingly to the selected option.