Skip to main content
Navigator | Tier 3
August 27, 2022
Question

Set text of text box using javascript

  • August 27, 2022
  • 3 replies
  • 847 views

Hi! I need help, I'm trying to run this code in javascript for to set value on textbox by ID but AA says "bot errot"

 

function editar (valor){

document.getElementById(Crm_CustomModule3_COBJ3CF82_LInput).value = valor;

}

This code works well in Chrome console.

 

I configured javascript actions like this:

 

image image

    3 replies

    Navigator | Tier 3
    August 29, 2022

    imageneed to use above command to run JS. and only for Chrome.

    Midna08Author
    Navigator | Tier 3
    August 29, 2022

    Thanks, but I need to set a variable like value, and I configured this, but still not working

     

    imageThe script is: document.getElementById("Crm_CustomModule3_COBJ3CF82_LInput").value = "$sFecVigIniPoliza$"

    Ashwin A.K
    Navigator | Tier 3
    August 30, 2022

    Hi @Erika Jaramillo​ ,

     

    I wouldn't recommend following this approach

     

    The document attribute is local to a given website i.e., Pure JS won't be able to detect it since its isolated from it.

    This is why Browser: Run Javascript works because it operates in the same session, but then there's the problem of not being able to pass in parameters.

     

    I'd recommend using the Capture Action, but if you really want to use JS then download and use the Web Automation Package.

     

    I must warn you though, the WAP is a community package so it won't receive official support.

     

    Kind Regards,

    Ashwin A.K

    Blogs at TheCodingTheory - https://www.thecodingtheory.com