Automatically fill fields in a web page's form?

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.

blocks (4)

blocks (5)

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??

https://puravidaapps.com/inject.php

There was a method to get elements by name document.getElementsByName() but it returns an array.

Yes offcourse, but with several modification, i change getElementByID to getElementByName

No, use:

document.getElementsByName()[0].value = getValue

I try to give array number [1] but still failed

I have tested with with javascript alert its work with that array number

I have tried that method, but still failed :thinking:

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

Is this the correct way to use evaluate js? The result is alert ‘getValue’ (tested with array number [0] or [1])

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

will this extension help - Fill Form Extension [FREE]

1 Like

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

Thanks, i will try…

Hi @Kenin, I test again your suggestion and finally work. Thank you so much for your help. :smile: :smile: :smile:

Capture

2 Likes

i think you should put solution to @Kenin’s post because he solved your problem

2 Likes

Ooops sorry, I’m out of focus… :smile: :smile: :smile:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.