# Validation

**URL:** <https://forum.kirupa.com/t/validation/299821>\
**Category:** web dev\
**Created:** [November 11, 2009, 2:00pm UTC](https://forum.kirupa.com/t/validation/299821 "2009-11-11T14:00:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wkt](https://avatars.discourse-cdn.com/v4/letter/w/ed655f/32.png) [@wkt](https://forum.kirupa.com/u/wkt)\
**Post date:** [November 11, 2009, 2:00pm UTC](https://forum.kirupa.com/t/validation/299821/1 "2009-11-11T14:00:01Z")

</div>

Hi there

I’m trying to validation on my form which only has 1 element in it. Simple enough but it took me hours, probably because I’m in a highly pissed state.

```auto

<html>
<head>
<script type="text/javascript">
function validate_form() {
    //with (thisform) {
        var id = document.sid.search_id;
        if (isInteger(id.value)) {
            return true;
        } else {
            alert("This is not a valid ID!");
            return false;
        }
    //}
}
</script>
</head>
<body>
<form name="sid" onsubmit="return validate_form()">
<input type="text" name="search_id"/>
<input type="submit" value="submit"/>
</form>
</body>
</html>

```

It doesn’t work. When I press submit, it passes the code as if it isn’t there. No matter what I put inside the text field, valid or not valid, it doesn’t work.

I only have JS experience of less than 24 hours. I’m just trying to get something up and running on my website desperately. Sorry if my question sounds stupid. :eyeup:

Anyway, thanks in advance.
