Auto Submitting form [js]

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…


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 :slight_smile: