Solved

Javascript Submit Link with Confirm box problems

Posted on 2004-09-09
6
275 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
  • 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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. …
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now