# Multipage form validation with javascript

**URL:** <https://forum.kirupa.com/t/multipage-form-validation-with-javascript/223279>\
**Category:** web dev\
**Created:** [April 20, 2007, 8:19pm UTC](https://forum.kirupa.com/t/multipage-form-validation-with-javascript/223279 "2007-04-20T20:19:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpearson311](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jpearson311](https://forum.kirupa.com/u/jpearson311)\
**Post date:** [April 20, 2007, 8:19pm UTC](https://forum.kirupa.com/t/multipage-form-validation-with-javascript/223279/1 "2007-04-20T20:19:27Z")

</div>

Hello all:

I’m building a multipage quote request form for a client of mine and I’m having some issues with the validation. I was wondering if anyone could possibly help me.

I have a simple form whoms action is set to delivery.php and it’s onsubmit event handler is set as so:

```auto
onsubmit="javascript:validatePersonal()"

```

The function validatePersonal looks like so:

```auto
function validatePersonal(){
    if(document.form.name.value == ""){
        window.alert("Please enter your name");
    }
}

```

The alert message is working fine if there is nothing in the form, but when I click ok, it still goes to the next page. How do I make it stay at the present page. Any help would appreciative. Thanks!

JPearson311
