See this blog post: http://developers.marketo.com/blog/add-a-full-name-field-to-a-marketo-form/
The script there is a bit old so use this one:
github.com/yanirclsr/MarTech/Full-Name