Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9305059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:50:45+00:00 2026-06-18T23:50:45+00:00

I have a view template which contains head, menu, footer (I will call this

  • 0

I have a view template which contains head, menu, footer (I will call this file as main template). This template is called by other pages which have some content. I decided to add form for login into menu. My first idea was about pass form from view file which is rendered via controller into main template by parameter but I don’t need show login form everytime on every page so this would’t be my solution.

I have two solution but in both I have a problem:

  1. I created form in main template with helper for form and input and button with pure html

    @helper.form(routes.Application.loginPosted,'class -> "navbar-form pull-right"){                                
    <input class="span2" type="text" placeholder="email" name="email">
    <input class="span2" type="password" placeholder="passwd" name="passwd">
    <button type="submit" class="btn btn-primary">Login</button>
    }
    

    and I handle it in controller as DynamicForm and want it transfor into form which represent a model for easier validation

    DynamicForm requestData = form().bindFromRequest();
    Form<User_Login> loginFormFilled = form(User_Login.class);
    loginFormFilled.fill(new User_Login(requestData.get("email"), requestData.get("passwd")));
    

    but loginFormFilled.get().email (and passwd too) is always blank and I don’t understand why.

  2. I wanted create form in main template as a model representation but I can’t write code which will be compile (it has problem with logForm I know that it is incorrect but I yet tried lots of combination but I can’t create valid form)

    @val logForm = new Form[User_Login]
    @helper.form(routes.Application.loginPosted,'class -> "navbar-form pull-right"){
    @helper.inputText(
            logForm("email")
    )
    @helper.inputPassword(
            logForm("passwd")
    )
    <button type="submit" class="btn btn-primary">Login</button>
    }
    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T23:50:47+00:00Added an answer on June 18, 2026 at 11:50 pm

    You don’t need to use DynamicForm binding for filling the Form<User_Login> you can do that at once (and probably that’s solution for you):

    public static Result loginApproach(){
        Form<User_Login> loginForm = form(User_Login.class).bindFromRequest();
    
        String formToString =
                loginForm.get().email + " with pass: " + loginForm.get().passwd;
    
        return ok(formToString);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a grid view which contains a button in a template field. I
I have a view and template called index.html. I have a image which is
I have an Editor Template which contains a table row with (among other stuff)
I have a view which contains (among other columns) a header name, and an
I have a template which is of .php extension. This template contains the html
I have a class called Timestamp. This class contains a static NSDate variable which
Say I have a template which displays a view based on a property: {{#if
I have the given view and template code, when i try to run this
I have a standard grid view, which contains a number of bounded fields and
In an MVC4 project, I have a form that contains a partial view which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.