Hello carlos,
You forgot the question, but I take it that the question is how-to programmatically submit this form?
If the form would have had an id (id="login") attribute set on the form itself then you would have been able to use:
But there is no id.. the alternative to select by name also is not available in your example form.
So that suggests that there's no way to do this without going down to javascript level, or is there?
Note: you can always handle these type of issues with a bit of javascript, but luckily you don't have to do that as there is an easier way to do so.
An alternative way on clicking on that submit button would be to send a "click" to the button instead of submitting the form.
Imagine your form had the id set to login as above then the following would work.
This says, click on the html element that is of type input in a fieldset in the html element with an id set to "login".
Fine, but we don't have the id set, let's make it more general.
So now we're telling the AntView control to click on a html element of type input inside a fieldset which is in a form.
This already works if you would test it on a html file that you presented.
However.. what if html has more than one form in there that matches this selector? Can we be a bit more specific?
Turns out we can.
The following is what I suggest you use:
here we're telling the AntView control to click on a html element of type input inside a fieldset which is in a form that has a class set to "formulario".
And that.. hopefully is specific enough for your needs.
edit: see also the help on ElementClickByQuerySelector for a bit more background info.
--
Wil
You forgot the question, but I take it that the question is how-to programmatically submit this form?
If the form would have had an id (id="login") attribute set on the form itself then you would have been able to use:
Code:
Private Sub SubmitButton_Click()
Document.RequestFormSubmitById "login"
End Sub
But there is no id.. the alternative to select by name also is not available in your example form.
So that suggests that there's no way to do this without going down to javascript level, or is there?
Note: you can always handle these type of issues with a bit of javascript, but luckily you don't have to do that as there is an easier way to do so.
An alternative way on clicking on that submit button would be to send a "click" to the button instead of submitting the form.
Imagine your form had the id set to login as above then the following would work.
Code:
Private Sub SubmitButton_Click()
Document.ElementClickByQuerySelector "#login > fieldset > input"
End Sub
This says, click on the html element that is of type input in a fieldset in the html element with an id set to "login".
Fine, but we don't have the id set, let's make it more general.
Code:
Private Sub SubmitButton_Click()
Document.ElementClickByQuerySelector "form > fieldset > input"
End Sub
So now we're telling the AntView control to click on a html element of type input inside a fieldset which is in a form.
This already works if you would test it on a html file that you presented.
However.. what if html has more than one form in there that matches this selector? Can we be a bit more specific?
Turns out we can.
The following is what I suggest you use:
Code:
Private Sub SubmitButton_Click()
Document.ElementClickByQuerySelector "form.formulario > fieldset > input"
End Sub
And that.. hopefully is specific enough for your needs.
edit: see also the help on ElementClickByQuerySelector for a bit more background info.
--
Wil