Auto-filling Forms with jQuery and the Web Storage API

I tried this example on iPhone. I get this error SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent.

I looked this up and this seemed to be because of the Safari privacy settings on iPhone.
I switched to ‘Allow all’. Then the error in the console dissapeared. Then I wasn’t able to submit the form.
when i submitted the form in the console with $(‘#form’).submit() I had this error

QuotaExceededError: DOM Exception 22

Checked this also and Safari seemed to be in ‘Private Browsing mode’. When I turned this of I was able to run the examle on iPhone