pthornt1
11-02-2012, 08:52 PM
Link to site: http://mcgehee.ace-onecomputers.com/test
if you go there, you can see that after you click "submit" a dialog pops up asking you to click ok/cancel, what i'm trying to do is when you click ok, it submits the form. However, all it does is close the pop up window.
Why?
JavaScript:
<script type='text/javascript'>//<![CDATA[
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){
document.form[email].submit();
}else{
}
}
});
}
//]]>
</script>
HTML Form:
<div class="form-wrapper">
<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="return go_there();">Send</button>
</div>
if you go there, you can see that after you click "submit" a dialog pops up asking you to click ok/cancel, what i'm trying to do is when you click ok, it submits the form. However, all it does is close the pop up window.
Why?
JavaScript:
<script type='text/javascript'>//<![CDATA[
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){
document.form[email].submit();
}else{
}
}
});
}
//]]>
</script>
HTML Form:
<div class="form-wrapper">
<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="return go_there();">Send</button>
</div>