GuzJadab
(Zaid Ramadhan)
January 22, 2021, 1:03pm
1
I was looking for a way to autofill the mikrotik login form, and I got an article about filling out automatic forms with javascript from the Taifun site . Can this trick be applied to source code that does not have an element ID?
I have uploaded an example form at this address https://absensheet.000webhostapp.com/
I try to change block procedure getElementByID to getElementByName, but the form still not filled.
can anyone help me? Thank you in advance
This is my aia : inject (1).aia (2.6 KB)
Did you follow all the steps mentioned in this Page??
Kenin
(Kenin)
January 22, 2021, 1:22pm
3
There was a method to get elements by name document.getElementsByName() but it returns an array.
GuzJadab
(Zaid Ramadhan)
January 22, 2021, 1:24pm
4
Yes offcourse, but with several modification, i change getElementByID to getElementByName
Kenin
(Kenin)
January 22, 2021, 1:27pm
5
No, use:
document.getElementsByName()[0].value = getValue
GuzJadab
(Zaid Ramadhan)
January 22, 2021, 1:28pm
6
I try to give array number [1] but still failed
I have tested with with javascript alert its work with that array number
GuzJadab
(Zaid Ramadhan)
January 22, 2021, 1:30pm
7
I have tried that method, but still failed
Kenin
(Kenin)
January 22, 2021, 1:33pm
8
You can use the EvaluateJs block of WebViewer with this js:
document.getElementsByName("username")[0].value = `getValue`
3 Likes
Js mode is getbyname but you have added with get id
It wont work
GuzJadab
(Zaid Ramadhan)
January 22, 2021, 1:44pm
10
Is this the correct way to use evaluate js? The result is alert ‘getValue’ (tested with array number [0] or [1])
GuzJadab
(Zaid Ramadhan)
January 22, 2021, 1:48pm
11
The id is just for variable name (original from taifun aia) and I didn’t change it, but the contents refer to the name element
GuzJadab
(Zaid Ramadhan)
January 22, 2021, 1:54pm
13
Thanks for the suggestion, but it looks like it’s only for forms that contain an element id. In my case, a website that doesn’t have an element ID.
Hard to getElementByName, because in the html code this field have further infield but you can try to get with this block
1 Like
GuzJadab
(Zaid Ramadhan)
January 22, 2021, 2:21pm
16
Hi @Kenin , I test again your suggestion and finally work. Thank you so much for your help.
2 Likes
i think you should put solution to @Kenin ’s post because he solved your problem
2 Likes
GuzJadab
(Zaid Ramadhan)
January 22, 2021, 2:52pm
18
2 Likes
system
(system)
Closed
February 21, 2021, 2:52pm
19
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.