First: It's common mistake - disabled
attribute disables the field even from sending, so it isn't even available to play a the request time. Use readonly
instead. (more about disabled
vs readonly
)
@input(myForm("number"), '_label -> "Number") { (id, name, value, args) =>
<input type="text" name="@name" id="@id" value="@value" @if(!value.isEmpty){ readonly="readonly" }>
}
Maybe you will need to use some CSS/JS for accenting that the field is readonly, otherwise often users considers it as a bug (I can't edit this field and don't know why)
Second: If it's really String
field - I don't know the reason. If it's Date
problem is caused by format change, Play can not parse automatically. You will need to parse it as well with the given format in your controller before the save/update.