Hi, Your function validateForm(), returns value only when email value is not null.So there's two loop happening:1) If email value is not null, script is going to next page and inserting data.2) If email value is null, your function returns nothing, so script goes to else part and never goes to next ...