The user enters input to fill the form, but I want to manually complete one field. I've tried using document.getElementById(certificate_request_commonname__row).createAttribute("value","abc");
but it doesn't work. In the form i'm adding data to a table. certificate_request is the name of the table and commonname is the column name. After I've looked on the web2py book I saw that I have to write: tablename_columnname__row. I've done that but it doesn't work. it always says to me: Empty string passed to getElementById(). Can anyone help?
certificate_request_commonname__row
is just a wrapper element that contains the input element. Instead, you must identify the input element itself. Also, don't use createAttribute
-- just set the .value
attribute:
document.getElementById('certificate_request_commonname').value = 'abc'