Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Web browsers don't display the save password box when using AJAX

    I built a login form that posts data back to the server using AJAX. The form has a button not a submit button. Browsers don't display the save password dialog box when I click the login button. Is there anyway to instruct the browser to save the password? It works correctly if I change the login from AJAX to the usual POST.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    The reason why it does not prompt it is because the browser needs the page to phyiscally to refresh back to the server. A little trick you can do is to perform two actions with the form. First action is onsubmit have it call your Ajax code. Also have the form target a hidden iframe.

    Code:
    <iframe src="ablankpage.htm" id="temp" name="temp" style="display:none"></iframe>
    <form target="temp" onsubmit="yourAjaxCall();">
    See if that causes the prompt to appear.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    THANK YOU this solution worked beautifully for me
    Quote Originally Posted by A1ien51 View Post
    The reason why it does not prompt it is because the browser needs the page to phyiscally to refresh back to the server. A little trick you can do is to perform two actions with the form. First action is onsubmit have it call your Ajax code. Also have the form target a hidden iframe.

    Code:
    <iframe src="ablankpage.htm" id="temp" name="temp" style="display:none"></iframe>
    <form target="temp" onsubmit="yourAjaxCall();">
    See if that causes the prompt to appear.

    Eric

  • #4
    New to the CF scene
    Join Date
    May 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it works for IE, but not Chrome ... anything code i need to add for Chrome?


  •  

    Posting Permissions

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