This is such a simple question, but some complex answers are given here.
Just do the following:
In this case, you don't need two forms (this is very important due to maintainability). You don't need two rows either.
Note: There are several alternatives (some of them maybe better from performance perspective) but I won't mention that to keep it simple and clear.
You could do this with conditional formatting. So make two rows, and with the editable field and and one with readonly. Use conditional formatting to display the two different views like David said.
The proposed solution won't work. In my version (4.2.1) of Mendix, I don't have the option "conditional formatting". I need to have something like the an indicator to see whether the record is read from the database or is new in memory. Or I need to condition the button (new or edit) that is used.
You need to create a boolean value that is true when a new record is created and false when a new record isn't. Then in a data view sourcing the entity create 2 rows. Right click the rows to edit their conditional value and set them according to the boolean you created.
You can make the boolean attribute be a calculated value since you probably don't want your user checking a box before creating a new record. In this case when creating the attribute choose for it to be a calculated value and in the microflow retrieve the new record and compare its size (if its greater than 0 its a new record, mind you this is assuming new records are string attributes).
Hope that helps.
I still think the simplest solution is to create 2 copies of your form - one connected to your New button, and the other connected to your Edit button. Set the attribute editable property to read-only (Never) in the Edit View. But if you really want to use a single form view...
You control editability of an attribute through a boolean or selection attribute. So you probably need to add a new boolean attribute to the entity in your domain model, then add workflow to set a suitable value to that attribute. You can then set the Editable property of the field to Conditional, select your new boolean and set editability for each possible condition.