What I'm making is like a slow chat to communicate with faraway friends .
I want to disable only an input with the id "name" after the user submits a form. I also want to store the input in a cookie for later. (So if the user logs in again the input is disabled with the "name" in it.)

I was stuck at the disabling. The problem is that every time the user clicks on submit, the page refreshes and the disable switched off. Isn't there a simple way to fix this?

So far, the Javascript is:
function disable(){
And then the submit button runs the script.