Solved

Javascript Submit Link with Confirm box problems

Posted on 2004-09-09
6
280 Views
Last Modified: 2008-03-17
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
Comment
Question by:LTY83
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 12018142
<A href="#" onclick="if(confirm('Are you sure?')document.dupeForm.submit();return false;">submit</a>
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 500 total points
ID: 12018148
oops, missing )

<A href="#" onclick="if(confirm('Are you sure?'))document.dupeForm.submit();return false;">submit</a>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 12018165
<a href = "#" onClick="if (confirm('Are You Sure You Want To Duplicate This Quote?'))document.dupeForm.submit();return false;">Duplicate Quote</a>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:LTY83
ID: 12018175
looks good, but are ya missing a ), if so where should it be put? at the end of the whole js statement?
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 12018214
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
 
LVL 4

Author Comment

by:LTY83
ID: 12018909
Thanks!
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question