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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:17:30+00:00 2026-06-05T08:17:30+00:00

so i am using the play framework and I’m try to create multiple submit

  • 0

so i am using the play framework and I’m try to create multiple submit buttons that call the one form:

So what I have is a list of strings, and i would like to create two buttons that will go back to the server and complete an event, the first is send the second is cancel. What i would like to also do is set the source value equal to what is selected in the foo select object. How would I go about doing this? Do i need to create a javascript even that is fired from the form and then get the var inside that function and then fire off the submit? Im not 100% familiar with play framework and scala, so im not sure if i can get it somehow inside this code without using a new method.

@(myList: List[String], theForm: Form[Obj])
@import helper._
@main("myVar Controller") {

<select id="foo">
</select>

<table border="1">
    <tr>
    @for(myVar <- myList) {
        <td>@myVar
        @form(routes.Application.method()) {
        <div id="hiddenForm" style="visibility:hidden">
            <input type="text" name="commandID" id="commandID" value="10" />    //Send Code
            <input type="text" name="source" id="source" value=**"Put selected value of foo here" />**
            <input type="text" name="destination" id="destination" value="@myVar" />
        </div>
        <input type="submit" value="Send" />
        }
        @form(routes.Application.method()) {
        <div id="hiddenForm" style="visibility:hidden">
            <input type="text" name="commandID" id="commandID" value="18" />    //Undo code
            <input type="text" name="source" id="source" value=**"Put selected value of foo here" />**
            <input type="text" name="destination" id="destination" value="@myVar" />
        </div>
        <input type="submit" value="Undo" />
        }
        </td>
    }
    </tr>
</table>

}

  • 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-05T08:17:31+00:00Added an answer on June 5, 2026 at 8:17 am

    First of all, the html isn’t valid.
    You should first make sure that there aren’t elements that have the same id.

    You have to use javascript to change a value in your form.
    I’m not familiar with scalar or playframework, but if they allow you to use jQuery, I recommend the following solution.

    $("#foo").bind("change", function(){$("#source").val($("#foo").val()));});​
    

    example:
    http://jsfiddle.net/RubenJonker/a8a8p/5

    If they don’t allow you to use jQuery, then you should put some javascript in the onchange event of the select.

    <select onchange="document.getElementById('source').value = this.value">
    </select>
    

    example:
    http://jsfiddle.net/RubenJonker/a8a8p/4

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Play framework 2.0.1 in scala to create an application that has
I have a Play Framework application that sends emails using SMTP server. Now I
Using play framework 1.2.4 with scala. I have few play jobs that looks like
I'm using the Play! framework and I have a model (an Entity) that has
I am using Play Framework 2.0.1. I have created a Java application using the
Ok, I have been thinking of developing a web application using the play framework
i am using guice with java play framework. i have a simple command interface,
Using play framework 2.0 in Java mode and I want to pass a list
I am creating my first project using play framework on NetBeans and I have
I have the following Play Framework entity (using Morphia for persistence) as part of

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.