forms login and password help

I want to submit a username and password from one form and submit it to annother using the webbrowser control to login to a website like this:

"form2"
enter username and password
*user submits Username and Password*
*form2 hides and form1 shows*

"form1"
*webbrowser1 shows website then logs into account*
chrisyroidAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongCommented:
In form1 , try insert:

Private Sub Command1_Click()
    Form2.Show vbModal
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set Form1 = Nothing
End Sub

in form 2:

Private Sub Command1_Click()
    Form1.WebBrowser1.Navigate2 "http://www.yourdomain.dom/app/login.html"
   
    Unload Me
    DoEvents
   
    Do While Form1.WebBrowser1.Busy
        DoEvents
    Loop    
   
    With Form1.WebBrowser1.Document
        .All("loginID").Value = Text1.Text
        .All("password").Value = Text2.Text
        .All("Submit").Click
    End With    
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set Form2 = Nothing
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ryan ChongCommented:
Change these 3 lines accordingly:

>>.All("loginID").Value = Text1.Text
>>.All("password").Value = Text2.Text
>>.All("Submit").Click

means in your HTML form , must got elements of "loginID" , "password" and a submit button named as "Submit" . You need to change it accordingly.

Hope this helps
0
chrisyroidAuthor Commented:
I laso want to know how to do this with asp
0
Ryan ChongCommented:
>>I laso want to know how to do this with asp
It's all depends on your web page design whether you want to have a popup login window or not, basically, you can directly put the login form into the web page, and hence a popup login window is NOT necessary.

For futhermore, you can try post a separate question on this issue, since:

* It's consider a New question as it's different from what you asking
* The popup login window issue should ask on ASP/ Javascript TA.

regards
0
Ryan ChongCommented:
Here is the basic login form, login.html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="JavaScript">
      function validate(frm) {
            if (frm.loginID.value == "") {
                  alert("Please enter your username.");
                  frm.loginID.focus();
                  return false;
            }
            if (frm.password.value == "") {
                  alert("Please enter your password.");
                  frm.password.focus();
                  return false;
            }
            return true;
      }
</script>
<body>
<form name="form1" method="post" action="process.asp" onSubmit="return validate(this)">
  <h2><strong>User Login</strong></h2>
  <p>Username:
    <input name="loginID" type="text" id="loginID">
  </p>
  <p>Password:
    <input name="password" type="password" id="password">
  </p>
  <p>
    <input type="submit" name="Submit" value="Submit">
    <input type="reset" name="Reset" value="Reset">
  </p>
</form>
</body>
</html>

Try customize it accordingly.

Also, try close your new open thread, i thought you mean create a totally new form... sorry if that bring misunderstanding..
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.