Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

Javascript Submit Link with Confirm box problems

I have text link that should submit form, before submitting form it should verify if you would like to proceed w/ submitting form, then if you hit ok it should submit it, however when you hit ok it does nothing. If I use a submit button it works, and i do not need the document.dupeForm.submit()" if i use a submit button, however i cannot use a submit button when doing this, it must be done w/ a text link

here is the code:
<form action = "http://127.0.0.1/quotes/duplicate.asp" method = "post" name="dupeForm">
      <td bgcolor = "white" style = "border:1px black solid;font-size:9pt;font-weight:bold;border-top:0px;"><a href = "#" onClick="return confirm ('Are You Sure You Want To Duplicate This Quote?');document.dupeForm.submit()">Duplicate Quote</a></td>
</form>

thanks!
0
LTY83
Asked:
LTY83
  • 4
  • 2
1 Solution
 
knightEknightCommented:
<A href="#" onclick="if(confirm('Are you sure?')document.dupeForm.submit();return false;">submit</a>
0
 
knightEknightCommented:
oops, missing )

<A href="#" onclick="if(confirm('Are you sure?'))document.dupeForm.submit();return false;">submit</a>
0
 
knightEknightCommented:
<a href = "#" onClick="if (confirm('Are You Sure You Want To Duplicate This Quote?'))document.dupeForm.submit();return false;">Duplicate Quote</a>
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LTY83Author Commented:
looks good, but are ya missing a ), if so where should it be put? at the end of the whole js statement?
0
 
knightEknightCommented:
FYI - with a button:

<INPUT type="button" name="btnSubmit" value="Submit"  onclick="if(confirm('Are You Sure You Want To Duplicate This Quote?'))this.form.submit();" />
0
 
LTY83Author Commented:
Thanks!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now