Jump to content

Recommended Posts

Posted

Hello I have a script that loops through a button. The button click works fine. However, I have a js dialog box that pops up and it does not click "OK". Any reason why its not working? I can't seem to figure out the problem.

My HTML code:
 

<button id="cancel" class="submit button-1" type="button" data-cmsg="Are you wanting to cancel?" value="Submit"> <span>Cancel</span></button>

My JavaScript code:

var message = $(this.triggeringElement).attr('data-cmsg');
if (message.lenth > 0){
  var c = confirm(message);
  if (c == false) {
    return false;
  }
}

and here is my Autoit Script:

$tags = IETagNameGetCollection($oIE,"button")
For $tag in $tags
    $id_value = $tag.id
    If $id_value = "Cancel" and $tag.InnerText = "Cancel" Then
        _IEAction ($tag, "click")
        WinExists("Message from webpage")
        Send("{Enter}")
    EndIf
Next

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...