Set Value doesn't save values when I click on Submit button

262 views Asked by At

I have a page where I'm setting the value of text boxes using document.getElementById, but when I'm clicked on "Guardar" button the values doesn't saves, how can I solve?

This is the code:

document.getElementById("Crm_CustomModule3_COBJ3CF82_LInput").value = "01/10/2022"

This is the text field that I set (vigencia hasta):

enter image description here

And this is the page after y clicked on "Guardar" button

enter image description here

The value doesn't saves.

2

There are 2 answers

1
Raja M On

Have you have input textbox id as Crm_CustomModule3_COBJ3CF82_LInput

0
user22961083 On

You probably need to trigger the onChange or onInput listener to save your input. Depends on the site structure. Something like:

element.dispatchEvent(new Event('change',{'bubbles':true}))

or

element.dispatchEvent(new Event('input',{'bubbles':true}))