I've a script and his code snippet:
but.onclick = function() {
var form;
var constructor = new Constructor();
var builder = new BidFormBuilder();
constructor.setFormBuilder(builder);
constructor.constructForm();
constructor.displayForm();
form = constructor.getForm();
form.getSubmitButton().onclick = function cl() {
var phone = form.getPhone().childNodes[1].childNodes[1];
if (phone.value === '') {
//Re-run code instruction must been here.
}
};
};
How to re-run the entire script when phone.value === '' is true?
function buildForm() { }, and in theifstatement, if it passes, callbuildForm()function