Question

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?

Was it helpful?

Solution

You could pass default value like

 @inputText(pForm("email").copy(value=Some("abc@def.com")),'_label -> "Email", '_showConstraints -> false, 'placeholder -> email)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top