I am trying to pass a variable in an html field, I succeed in that task thank to this answer : https://stackoverflow.com/a/5422395
The scenario is a user click on : http://some.site.com/somePage.html?forename=Bob&surname=Jones
And the field forename is prepopulate on the page with Bob, but I encounter an issue with the answer mentionned earlier, if there is no variable in the url (e.g. http://some.site.com/somePage.html) what the user enter into the field forename will not be taken into account by the form.
How could I prefill the field only if the variable is present in the url and let the user input what he wants if not ?
Thank you for your help,