Hi diodenko. Welcome to SitePoint.
I'm not quite clear on what you are doing here. Are you using the Mac program called TextEdit? If so, you may need to change the preferences in that program for it to work for you as a code editor.
Go to TextEdit > Preferences and in the New Document tab, choose
Format: plain text
and in the Open and Save tab, choose
When opening a File:
- ignor rich text commands (both options)
and choose other settings in that tab appropriate for html files.
Does that help?
If not please describe in more detail what is happening, and rather than say things like "opens up as a website form", say exactly what you mean, as I don't understand what that means.