PennController for IBEX › Forums › Support › Timeout in Filled Inputs with failure test › Reply To: Timeout in Filled Inputs with failure test
July 10, 2023 at 11:38 am
#10734
Jeremy
Keymaster
Hi,
Nice solution. A slightly simpler alternative would be to stop the hurry timer in the TextInput element’s callback instead of using a dummy Timer element to accomplish the same:
newTimer("hurry", 3000).start() , newTextInput("answer") .before(getText("Preamble")) .log("validate") .lines(1) .cssContainer("display", "flex") .print() .callback( getTextInput("answer").test.text(/^(.{10,500})$/) .success( getTimer("hurry").stop() ) .failure( newText("<b>Please write more.</b>").color("red").print() ) ) , getTimer("hurry").wait()
Jeremy