Discussions » Development

Helpme with this code

§
Posted: 24.04.2024

How to fill two textbox with the same Element , i try use this code but only one textbox filled (first textbox) the second textbox not filled, here's the code. " // Function to input value and click "NEXT STEP"
function inputAndClickNextStep() {
// Find both textboxes
var inputElement1 = document.querySelector('input[name="antibot_number_0"]');
var inputElement2 = document.querySelector('input[name="antibot_number_1"]');

// Check if both textboxes are present
if (inputElement1 && inputElement2) {
// Fill both textboxes with the value
inputElement1.value = "123";
inputElement1.dispatchEvent(new Event('change'));
inputElement2.value = "789";
inputElement2.dispatchEvent(new Event('change'));

// Find and click the "NEXT STEP" button
var nextButton = document.querySelector('button.custom-button[type="submit"]');
if (nextButton) {
nextButton.click();"

§
Posted: 20.06.2024

Hello, you can contact an outsource web development company. I just do my projects myself and manage them myself, but when I don't have time or can't, I turn to them.

Post reply

Sign in to post a reply.