SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2010
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question confirm JavaScript

    Hi
    I have Web form generated from CRM web Application. this form is to collected the leads and send them to CRM system I want to prompt the user using JavaScript to confirm or review the data . but my problem the form will still send the data even if the user click "cancel". thank you for your help
    Code:
    	$('input[name$="save"]').click(function () {
    		
    			  var answer = confirm('Are you sure you want to send the lead?');
          
                    if (answer==true ) {
                        alert("thanks");
                    }
    				if(answer == false)
    				{
    					
    					alert("Please review!");
    				}
    	});

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems that you are using jQuery, this should help you http://api.jquery.com/event.preventDefault/ .

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2010
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thnaks for Help


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •