0

In an XPage I have a form with some Editbox fields for user input. The fields are writable.

For convinient test purposes I created an Auto-Fill Button which should fill in the form programmatically. There for I use some SSJS code triggered by a Click Event.

The Scipt code looks like this :

var id ='#{javascript:getClientId("company")}';
document.getElementById(id).innerHTML= 'Test company';

While this piece of code works best with computedFields, it doesn‘t work with Editbox‘s.

What do I miss here ?

Ben
  • 677
  • 5
  • 19

1 Answers1

2

innerHTML does not work for input element (Edit box renders as input). Use value instead: Set Value of Input Using Javascript Function

Community
  • 1
  • 1
Frantisek Kossuth
  • 3,524
  • 2
  • 23
  • 42
  • When I use value : `document.getElementById(id).value= 'Test company';` it does not work either . – Ben Nov 05 '15 at 17:04
  • 1
    You are right, it works as you stated. It does not work with my code because I embedded setting the value with in an `If (...)` statement. And that never becomes true. So it could not work. – Ben Nov 05 '15 at 17:44