I do something like :
console.log(“ANFRAGE SENDEN”);
var field_selector = “anfrage_closed”;
$(‘.tablesome__tbody tr td.tablesome__cell–text’).trigger(‘blur’);
$(‘.tablesome__tbody input’).trigger(‘blur’);
$(“.tablesome__tbody td.tablesome__cell–text[data-label='” + field_selector+”‘]”).first().trigger(‘focus’); $(“.tablesome__tbody td.tablesome__cell–text[data-label='” + field_selector+”‘]”).first().trigger(‘click’);
$(“.tablesome__tbody td.tablesome__cell–text[data-label='” + field_selector+”‘]”).first().find(“input”).trigger(‘focus’); $(“.tablesome__tbody td.tablesome__cell–text[data-label='” + field_selector+”‘]”).first().find(“input”).trigger(‘click’);
await sleep_anfrage(1);
var focused_field = $(“.tablesome__tbody tr td.tablesome__cell–text.tablesome__cell–edit”);
console.log(“focused_field” + focused_field.html())
var focused_input = focused_field.find("input");
console.log("focused_input.html()" + focused_input.html())
if(focused_input.length) {
console.log("FOUND A TEXT FIELD");
const textField = focused_input.get(0);
textField.value = "yes";
// Fire a change event on the text field
textField.dispatchEvent(new Event(‘change’));
const simulatedInputEvent = new InputEvent(‘input’, {
data: ‘This is simulated user input’, // Text to be inserted
inputType: ‘insertText’ // Simulates typing new characters
});
// Dispatch the simulated input event on the text field
textField.dispatchEvent(simulatedInputEvent);
}
So i have to blur fields, focus fields, simulate user inputs. Just putting in the .val() doesnt work. Is there a way to change that?