Setting the value of an xforms:input with JavaScript function setTextfieldValue() { document.getElementById("input").value = "42"; } Set textfield value