Welcome Guest Search | Active Topics | Sign In | Register

programmatically input username and password html tag no ID Options
Digital Ministry
Posted: Sunday, May 8, 2022 11:26:41 PM
Rank: Newbie
Groups: Member

Joined: 3/14/2022
Posts: 3
Hi

Need help to input username and password programmatically in page that doesnt have ID tag on the input box

Code: HTML/ASPX
<div class="mt-6">
                        <form method="POST" action="https://portal.pejer.app/login">
        <input type="hidden" name="_token" value="BWE7u1qzZpmzmUCrCH6IioybrktrvC8aZ6W45piQ">
        <div class="mb-6">
            <div>
            <label class="block text-sm font-medium leading-5 text-gray-800">Email</label>
        <div class="mt-1 relative rounded-md shadow-sm">
        <input type="email" class="form-input block w-full pr-10 focus:shadow-outline-red sm:text-sm sm:leading-5 " name="email" value="">
    </div>

    </div>
        </div>

        <div class="mt-6">
            <div>
            <label class="block text-sm font-medium leading-5 text-gray-800">Password</label>
        <div class="mt-1 relative rounded-md shadow-sm">
        <input type="password" class="form-input block w-full pr-10 focus:shadow-outline-red sm:text-sm sm:leading-5 " name="password" value="" >
    </div>

    
    </div>
        </div>


I know that if the page using id we only need to do :
document.getElementById('idname').value='inputvalue'

But on that code there is no id, i have try using GetElementbyClassName
document.getElementsByClassName('input.form-input.block.w-full.pr-10.focus\:shadow-outline-red.sm\:text-sm.sm\:leading-5').value="insertvalue"

but not working

any help to make this right ?

Thank you
eo_support
Posted: Monday, May 9, 2022 10:31:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 23,317
Hi,

We are not in a position to provide support on JavaScript code. You can use any JavaScript debugger (such as Google Chrome's devtools) to make sure you have the correct JavaScript code first. Once you have the correct JavaScript code, you can use WebView.EvalScript run the script.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.