Reply To: Updating checkbox scale conditionally

PennController for IBEX Forums Support Updating checkbox scale conditionally Reply To: Updating checkbox scale conditionally

#9642
Jeremy
Keymaster

Hi Laia,

Place the code you have after the first wait in callback instead:

newTrial("location",
    newText("Where do you live?").print().cssContainer({"margin":"1em"})
    ,
    defaultScale.radio().labelsPosition("right").log()
    ,
    newButton("go")
    ,
    newScale("us", 'California', 'New York'),
    newScale("uk", 'England', 'Scotland')
    ,
    newScale("country", "US", "UK").print().cssContainer({"margin":"1em"})
        .callback( 
            getButton("go").remove(),
            getScale("uk").remove().test.selected().success(self.unselect()),
            getScale("us").remove().test.selected().success(self.unselect())
            ,
            self.test.selected("US")
            .success( getScale("us").print().wait(),getButton("go").print() ) 
            .failure( getScale("uk").print().wait(),getButton("go").print() ) 
        )
    ,
    getButton("go").wait()
)

Jeremy