Possible Duplicate:
submit is not a function in javascript
How to submit form using JS
I have a contact form, and what is supposed to happen in the user clicks submit, a dialog box opens, they click OK, and then the form submits. However, when you click OK, it just closes the dialog box and DOES NOT submit the form. You can test the code by going here.
Javascript/jQuery: //
function go_there(){
$.prompt('<b>DISCLAIMER</b> <span style="font-weight:normal">TEXT WILL GO HERE</span>',{
buttons: { Ok: true, Cancel: false},
callback: function(e,v,m,f){
if(v){
$('#email').submit()
}else{
}
}
});
}
//]]>
</script>
HTML: //
<form method="post" action="nlphpmail.php" id="email">
<input type="hidden" name="subject" id="subject" value="Feedback form" />
<fieldset>
<div class="formfield">
<label class="text title" for="contact_who">Name</label>
<input type="text" class="text required" name="contact_who" id="contact_who" value="">
</div><!-- /.formfield -->
<div class="formfield">
<label class="text title" for="contact_sendto">Email address</label>
<input type="text" class="text required email" name="contact_sendto" id="contact_sendto" value="">
</div><!-- /.formfield -->
<div class="formfield">
<label class="text title" for="contact_phone">Phone</label>
<input type="text" class="text required" name="contact_phone" id="contact_phone" value="">
</div><!-- /.formfield -->
<div class="formfield">
<label class="text title" for="contact_message">Message</label>
<textarea name="contact_message" class="required" id="contact_message"></textarea>
</div><!-- /.formfield -->
</fieldset>
<div class="formfield">
<button class="button" id="submit" value="send" type="button" name="submit" onClick="go_there();">Send</button>
</div>
</form>