text.add(new AjaxFormValidatingBehavior(form, "onkeyup") {
private static final long serialVersionUID = 1L;
protected void onEvent(AjaxRequestTarget target)
{
text.validate();
submit.setEnabled(text.isValid());
target.addComponent(submit);
}
});
form.add(text);