Pergunta

Currently, I have a simple form that is Form[(String, String, String)]

In my scala.html file:

    @form(routes.Application.editParticipant(pid)) {
    @inputText(pForm("email"),'_label -> "Email", '_showConstraints -> false, 'placeholder -> email)
    @inputText(pForm("password"),'_label -> "Password", '_showConstraints -> false, 'placeholder -> password)
    @inputText(pForm("phone"),'_label -> "Phone number", '_showConstraints -> false, 'placeholder -> phone)
    <input type="submit" value="edit">
}

I want the form to submit the current values of email,password,phone if the user doesn't edit it. How do I do that?

Foi útil?

Solução

You could pass default value like

 @inputText(pForm("email").copy(value=Some("abc@def.com")),'_label -> "Email", '_showConstraints -> false, 'placeholder -> email)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top