# Auto Submitting form \[js\]

**URL:** <https://forum.kirupa.com/t/auto-submitting-form-js/200977>\
**Category:** web dev\
**Created:** [September 17, 2006, 9:29am UTC](https://forum.kirupa.com/t/auto-submitting-form-js/200977 "2006-09-17T09:29:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thesleuth](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@thesleuth](https://forum.kirupa.com/u/thesleuth)\
**Post date:** [September 17, 2006, 9:29am UTC](https://forum.kirupa.com/t/auto-submitting-form-js/200977/1 "2006-09-17T09:29:40Z")

</div>

I’m having some problems submitting a form… I’m using a javascript prompt to get the value and input it into a text field however in firefox, I’m experiencing ‘document.form.submit() is not a function’ error. Didn’t work in IE either. Here’s the code…

```auto

function pfa(){
    var i = prompt("What is your name?", "");
    if(i == "" | i == null){
        var i = prompt("What is your name?", "");    
    }else{
        clearInterval(check);
        document.form.name.value = i;
        document.form.submit(); 
    }
}

check = setInterval(\'pfa()\', 1);
<!-- Body Code -->
<form action="post.php?id=post" method="post" name="form">Your name: <input name="name" size="5" type="text" /><input id="submit" name="submit" type="submit" value="Go" /></form>

```

I did managed to get the value inputed but could not get the form to auto submit. Please help, thanks in advance 🙂
