I have the following function using the Ext message box prompt:
var prompt = function () {
Ext.Msg.prompt("Number", "", function (btn, text) {
if (btn == "ok") {
if ((![0-9][2-8]$/.test(text)) && (!/^[2-9].test(text))) {
alert("Please enter a valid number");
prompt();
} else {
});
// success code }
}
});
}
}
});
};
This works exactly the way I want it EXCEPT it doesn’t display the text entered in the text box when re-prompted on fail. Is there a way to pass in the ‘text’ variable into the re-call of the prompt function? Or does this just need a total re-architecture? What I’d like is the “please enter a valid number” alert to appear and then have the prompt display again with the already entered text.
Thank you!
that should do it. But you should took a look at the API. The last argument is the default value for the textfield within