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

  • Home
  • SEARCH
  • 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 8456663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:36:12+00:00 2026-06-10T12:36:12+00:00

am using a form with just one input text and one submit button. I

  • 0

am using a form with just one input text and one submit button. I want to forward the text from the input text field to a controller at the backend. perhaps if you take a look at the code snippet it gives a better picture of what I am trying to do.

this is from the index.html page

@helper.form(action=routes.Application.index()){       
<input type='text' name='myname' />
<input type='submit' name='mysubmit' value='Create Class' />    
}

below is a code snippet from the controller

public class Application extends Controller {

public static Result index() {
return ok(index.render(null)); }
}

the code displays the form as expected but I want to pass the string entered into the input text field to the controller method and then print the text. Like what is presented below.

System.out.println(variable);

where variable is the the test entered into the text field.
Any suggestions will be welcomed.

  • 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-10T12:36:14+00:00Added an answer on June 10, 2026 at 12:36 pm

    Use DynamicForm for that:

    public static Result index() {
        DynamicForm bindedForm = form().bindFromRequest();
        System.out.println(bindedForm.get("myname"));
        // or...
        Logger.info(bindedForm.get("myname")); 
            // Play's Logger is nicer than System.out.println();
        return ok(index.render(null)); }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Django and just trying to submit a form using ModelForms to
I have a form like so. <form name=theform id=theform> <input type=text name=name> <input type=submit
I have a form with the following field(this field is just one of 4)
CSS : form input:not([type='button']),form input:not([type='submit']) { width: 200px } HTML : <form> <input type='button'
I have form where before i was using simple post with <button name=submit id=register
I'm using Django-Registration and the form just has 3 fields (Username, Email, Password, and
I just designed a simple For Loop using window form application. I would like
I'm working on a simple, one field, form that works with AJAX. Every time
I'm making a form submit with jQuery's AJAX. I'm having several form's using AJAX
I just implemented FluentValidation , everything seems awesome except one awkward little detail. @using

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.