I'm having some problems with a javascript confirm() box. I have a onClick on a form submit button. it pops up and displays the data fine. but when the user clicks on the 'cancel' button it still submits the form and gos to the next page. the only thing that i can think of is that somehow its returning true for both the 'ok' and 'cancel' buttons. does anyone know what I'm doing wrong here? this is the exact code below.
Thanks in advance
| Code: |
| <script language="JavaScript" type="text/javascript">
<!-- //this script displays a summary of all the form data in a confirm box function summary(){ confirm( "Are you sure you want to submit this?\n\n email: "+document.email.email.value+ "\nAgency name: "+document.email.agency_name.value+"\nYour name: "+document.email.name.value+ "\nCategory: "+document.email.category.value+"\nRecord locator: "+document.email.record_locator.value+ "\nTicket Quote 2 name: "+document.email.quote.value+"\nTicket Issuance: "+document.email.issuance.value+ "\nAmadeus: "+document.email.amadeus.value+"\nAdditional: "+document.email.additional.value ); } // --> </script> <input name="submit" type="submit" value="Submit" onclick="summary();" /> |
Thanks in advance
