Results 1 to 6 of 6

Thread: [RESOLVED]Webbrowser password save

  1. #1

    Thread Starter
    Addicted Member messup000's Avatar
    Join Date
    Jun 2005
    Posts
    181

    Resolved [RESOLVED]Webbrowser password save

    Hi im building a webbrowser and have come to a bit of a problem. In firefox and ie6 and probly ALOt more webbrowsers you have the option of saving a password/user form. Im just wondering how can i check if theres anything in any textforms and give the users the option of saving their user/password.

    Thx a bunch

    messup000
    Last edited by messup000; Sep 30th, 2005 at 08:54 PM.

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Webbrowser password save

    VB Code:
    1. Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
    2. On Error Resume Next 'Needed so if there is no "password" field it will skip
    3. If (pDisp Is WebBrowser1.Application) Then
    4.     If WebBrowser1.Document.All.password.Value <> "" Then 'Field Name could be "password"
    5.         MsgBox WebBrowser1.Document.All.password.Value
    6.     End If
    7.     If WebBrowser1.Document.All.pass.Value <> "" Then 'Could be pass (Could be others!)
    8.         MsgBox WebBrowser1.Document.All.pass.Value 'You need to look at the source of the page to see what the 'name' of it is
    9.     End If
    10. End If
    11.  
    12. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Addicted Member messup000's Avatar
    Join Date
    Jun 2005
    Posts
    181

    Re: Webbrowser password save

    Yea i understand how to get it like that but what im really looking for is a way to get the name of a textfield that has a value

    thx for the try tho

    messup000

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Webbrowser password save

    ahh.. gim me a few
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Webbrowser password save

    VB Code:
    1. If (pDisp Is WebBrowser1.Application) Then
    2.     Dim HTML As HTMLDocument
    3.     Dim HT As HTMLInputTextElement
    4.     Set HTML = WebBrowser1.Document
    5.     For Each HT In HTML.All
    6.         If HT.isTextEdit And HT.tagName = "INPUT" Then
    7.             If HT.Type = "password" Then
    8.                 Debug.Print HT.Name
    9.             End If
    10.         End If
    11.     Next
    12. End If
    HT.Name will be what you are after
    or in place of Debug.print Grab HT.Value
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  6. #6

    Thread Starter
    Addicted Member messup000's Avatar
    Join Date
    Jun 2005
    Posts
    181

    Re: Webbrowser password save

    wow thats cool! This is going to help alot! And for the username all i have to do is check if any text imput boxes have text in them and save the name of the textbox!

    thx a bunch

    Messup000

Posting Permissions

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



Click Here to Expand Forum to Full Width