Guest User

Untitled

a guest
Jul 15th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <aura:component>
  2. <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
  3. <form action=" url" method="post" I'd="form"/>
  4. <Inputtype="submit",value="submit" >
  5. </aura:component>
  6.  
  7. doInit: function(component, event, helper)
  8. {
  9. $( "form" ).submit(function( event ) {
  10. event.preventDefault();
  11. return false;
  12. });
  13. }
  14.  
  15. submitForm : function () {
  16. $( "form" ).submit(function( event ) {
  17.  
  18. event.preventDefault();
  19. return false;
  20. });
  21. }
  22.  
  23. <input type="submit" name="submit" onsubmit="submitForm()"/>
  24.  
  25. $("form").submit(function( event ) {
  26. event.preventDefault();
  27. url = $form.attr( 'action' );
  28. var posting = $.post( url, { email: $('#email').val() } );
  29. posting.done(function( data ) {
  30. alert("success")
  31. });
  32. alert("submitted")
  33. });
  34.  
  35. $( "form" ).submit(function( event ) {
  36.  
  37. event.preventDefault();
  38. return false;
  39. });
  40.  
  41. <form action="javascript:return false" aura:id="sendNotificationForm" ... >
  42.  
  43. ({
  44. ...
  45. ,sendNotification: function(component, event, helper) {
  46. ....
  47.  
  48. event.preventDefault();
  49.  
  50. ...
  51. }
  52. ...
  53. })
Add Comment
Please, Sign In to add comment