Mon. - Fri. 9 am - 5 pm Ask a Question
Remember me

Input Fields

1 month 1 week ago #1

  • ian's Avatar
  • ian
  • Posts: 3
Hello

Is it possible for JavaScript to set the values of the text inputs, ie ...

document.getElementById("myText").value = "sometext";

Thanks

1 month 1 week ago #2

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 13499
Hello,

Thank you for contacting us!

Yes it is possible :)

Best Regards,
Vyacheslav, Balbooa Support Team

1 month 1 week ago #3

  • ian's Avatar
  • ian
  • Posts: 3
Can you indicate how its done, been trying with no success .

1 month 1 week ago #4

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 13499
You need to add the class custom-class for the field
and add the code in the code editor
document.addEventListener('DOMContentLoaded', function(){
    document.querySelectorAll('.custom-class').forEach(function(input){
        input.value = 'My Simple Value';
    })
});


Best Regards,
Vyacheslav, Balbooa Support Team

1 month 1 week ago #5

  • ian's Avatar
  • ian
  • Posts: 3
Thanks

1 month 1 week ago #6

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 13499
You are welcome ;)
Powered by Kunena Forum