Question

I encounter an error while compiling these code:

 @(newStaff: List[staffInfo], newStaffForm: Form[staffInfo])

@import helper._

@main("Simple application") {

    @form(routes.Application.newForm()) {

    @inputText(newStaffForm("name"))

    @inputRadioGroup(
    newStaffForm("gender"),
    options = Seq("M"->"Male","F"->"Female")
    '_label -> "Gender",
    '_error -> newStaffForm("gender").error.map(_.withMessage("select gender")))

    @inputDate(field = newStaffForm("dateOfBirth"), args = 'size -> 10)

    <input type="submit" value="Submit">

   }
}

The compilation error message : ')' expected but symbol literal found. The error is highlighted here -> '_label

Anyone know how to solve this problem?

Was it helpful?

Solution

It seems you just lack a comma after this line:

options = Seq("M"->"Male","F"->"Female")

It should be

options = Seq("M"->"Male","F"->"Female"), //note the comma in the end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top