Discussions » Demandes de création de scripts

Helpme with this code , please

§
Posté le: 25/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();"

Poster une réponse

Connectez-vous pour poster une réponse.