Results 1 to 2 of 2

Thread: Invoking Button

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2008
    Posts
    84

    Invoking Button

    here is my form code for the button i need to invoke
    PHP Code:
    <tr><td colspan="2" align="right">
    <
    input type="hidden" name="subjoin" value="1">
    <
    input type="submit" value="Join!"></td></tr
    this is part of my process.php which process the data given it, this determines the user is doing
    PHP Code:
    function Process(){
          global 
    $session;
          
    /* User submitted login form */
          
    if(isset($_POST['sublogin'])){
             
    $this->procLogin();
          }
          
    /* User submitted registration form */
          
    else if(isset($_POST['subjoin'])){
             
    $this->procRegister();
          }
          
    /* User submitted forgot password form */
          
    else if(isset($_POST['subforgot'])){
             
    $this->procForgotPass();
          }
          
    /* User submitted edit account form */
          
    else if(isset($_POST['subedit'])){
             
    $this->procEditAccount();
          }
          
    /**
           * The only other reason user should be directed here
           * is if he wants to logout, which means user is
           * logged in currently.
           */
          
    else if($session->logged_in){
             
    $this->procLogout();
          }
          
    /**
           * Should not get here, which means user is viewing this page
           * by mistake and therefore is redirected.
           */
           
    else{
              
    header("Location: index.php");
           }
       } 
    Here is the VB.net code
    Code:
     WebBrowser1.Document.GetElementById("Join!").InvokeMember("click")
    It doesn't invoke the button, should be an easy fix

  2. #2
    Fanatic Member newprogram's Avatar
    Join Date
    Apr 2006
    Location
    in your basement
    Posts
    769

    Re: Invoking Button

    if this is your website then just change this <input type="submit" value="Join!"></td></tr> to this
    <input type="submit" value="Join!" id="Join!" ></td></tr> and this should work fine WebBrowser1.Document.GetElementById("Join!").InvokeMember("click")

    if this is not your website then use this

    Dim HTML As HtmlDocument
    Dim HTMLI As HtmlElement
    HTML = WebBrowser1.Document
    For Each HTMLI In HTML.GetElementsByTagName("input")
    If ElseIf HTMLI.value = "Join!" Then
    HTMLI.InvokeMember("Click")

    End If
    Next
    Live life to the fullest!!

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