Posted By

pablazo on 09/19/07


Tagged

javascript links


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

joomla


assure a link is clicked once


 / Published in: JavaScript
 

URL: http://www.codingforums.com/archive/index.php?t-45202.html

  1. <html>
  2. </head>
  3. <script language="Javascript">
  4. function disableAfterSubmit(object) {
  5. //object.outerHTML = object.innerHTML;
  6. //alert(object.href);
  7. document.forms[0].textField.value = document.forms[0].textField.value + "1" ;
  8. // to check that this is working fine, just comment line below and the page won't redirect to anywhere, but this function won't be entered again.
  9. // (you can see that it is true because no more "1" are added to the textField in the form)
  10. document.forms[0].submit();
  11. }
  12. </script>
  13. </head>
  14. <body>
  15. <form name="listForm" action="http://www.google.com/gwt/secondPage.htm">
  16. <input type="text" name="textField">
  17. <a href="javascript:disableAfterSubmit(this);" onclick="this.onclick=function(){return false;}">Link - Submit</a>
  18. </form>
  19. </body>
  20. </html>

Report this snippet  

You need to login to post a comment.