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 8444727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:28:11+00:00 2026-06-10T09:28:11+00:00

@inputText( signupForm(email), ‘_label -> Email, ‘_help -> Enter a valid email address. ) How

  • 0
@inputText(
                signupForm("email"), '_label -> "Email",
                '_help -> "Enter a valid email address."
            )

How would I write this in pure html?

I have no idea how i add the value to the signupForm, so that I can use it in my controller with bindfromRequest() (in html)

Edit:

I normally used this approach

final static Form<User> signupForm = form(User.class);

and the the binding process

Form<User> filledForm = signupForm.bindFromRequest();

and my rendered form looks like this:

<div class="control-group ">
  <label class="control-label" for="email">Email</label>
  <div class="controls">

    <input type="text" id="email" name="email" value="" >

    <span class="help-inline"></span>
  </div>
</div>

And this worked for me I was just curious how to use pure html, so I could create my own little helpers.

Edit2:

public static Result blank() {
        return ok(form.render(signupForm));
    }

and in the template itself

@(signupForm: Form[User])

Edit 3:

I don’t know if this helps but the helper looks like this. (for the inputtext)
I just have no idea what this means, scala looks really cryptic to me.

@(field: play.api.data.Field, args: (Symbol,Any)*)(implicit handler: FieldConstructor, lang: play.api.i18n.Lang)

@input(field, args:_*) { (id, name, value, htmlArgs) =>
    <input type="text" id="@id" name="@name" value="@value" @toHtmlArgs(htmlArgs)>
}
  • 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-10T09:28:13+00:00Added an answer on June 10, 2026 at 9:28 am

    Use your browser to check the source coderendered by Play and copy/paste the HTML into your template.

    In general the most interesting for you is proper inserting value to the manually created field:

    <input type="text" name="email" value='@signupForm.field("email").value' />
    

    It’s also important to set the proper name attribut otherwise filling Form in controller will fail.

    Edit:

    Of course in blank action your signupForm is empty so that’s normal that there’s no value, in next action let’s name it saveBlank, you need to fill the form with request’s data, validate and save. If there are errors in form you need to render form.scala.view again with data binded to the form from previous request:

    public static Result saveBlank(){
        signupForm = signupForm.bindFromRequest();
        if (signupForm.hasErrors()){
            return badRequest(form.render(signupForm));
        }
    
        User user = new User();
        user = signupForm.get();
        user.save();
    
        return ok("user saved);
    }
    

    of course if you’ll want to edit existing user, you have to prefill it with data from DB ie:

    public static Result edit(Long id){
        signupform = signupForm.fill(User.find.byId(id));
        return ok(form.render(signupForm));
    }
    

    (note: I wrote it just from top of my head, so check pls if there are no typos or errors)

    Finally you don’t need to use Form object in every case, you can also use DynamicForm:

    public static Result saySomething(){
        DynamicForm df = form().bindFromRequest();
        return("you entered :" + df.get("email"));
    }
    

    or even in one line:

    public static Result sayShorter(){
        return("you entered :" + form().bindFromRequest().get("email"));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an input field taking an email address: <h:inputText value=#{register.user.email} required=true /> How
I have this a field: <h:inputText id=email value=#{user.user.email} title=Email validator=#{user.user.validateEmail} /> The validateEmail method
I'm new to JSF, so this question might be strange. I have an inputText
I have a <h:inputText> which accepts a long value like this <h:inputText value=#{ServiceTable.ID} />
this is a chat application in openlaszlo. i write in the inputtext area. and
I have an inputText and a commandButton in a JSF page. The user inputs
Suppose I have two h:inputText components. I want to bind both of the text
I would like to make a JSF inputText field into upper case when the
I am trying to have an h:inputText switch out with a different one when
I have an Employee object I am showing in inputtext. For example, the firstname

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.