I was wondering if it is possible to save some data with PHP getting the value from a form placed in the page by javascript with document.write, the value of which has been set by javascript with document.getElementbyId(id).value.
I know that with .innerHTML() it doesn’t work, since the save button doesn’t get a value set with the .innerHTML() method.
So I was wondering, would it work if I have javascript place an input box with document.write and then its value is set by another js function?
Yes, as long as you place the
<input>inside a form.Here is a simple example:
PHP:
HTML: