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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:32:38+00:00 2026-05-27T19:32:38+00:00

The trivial task became really time consuming for me. I am doing really basic

  • 0

The trivial task became really time consuming for me. I am doing really basic user interface for web project(focus on business logic). If there is already exact answer to my question please redirect me, I will delete it straight away. I just don’t really know what to search for, basic phrases are too vague.

The scenario:

I need to get request either with /someurlrequest?edit=(idOfelement) or /someurlrequest?populate=(idOfElement) , but I get /someurlrequest?edit=(idOfelement)&populate=(idOfElement) (GET is just for showing what is sent, POST is preferred)

Whenever set of elements appear I want to have two buttons, but whenever I do it the way I’ve shown below the form submit action grabs both values(Edit and Populate) for request meaning that further I can’t process the request since I don’t know which button was pressed as both name/value pairs are passed, I get say Edit=1 and Populate=1 , I obviously want only single pair either Edit=1 or Populate=1.

 <c:forEach var="TrainingProgram" items="${programbank}">

     <form method="get" action="/someurlrequest">
        <p> ${TrainingProgram.name}</p 
        <p> ${TrainingProgram.shortDescription}</p>

   <p>    
     <input value="Edit" type="submit" />  
     <input name="edit" style="display: none;" value="${TrainingProgram.programId}" />
     <input value="Populate" type="submit" />
     <input name="populate" style="display: none;" value="${TrainingProgram.programId}" />   

   </p>
     </form>
 </c:forEach>

I would be able to get away with basic:

 <a href="/somerequest/edit=${TrainingProgram.programId}"> Edit <a/>
 <a href="/somerequest/populate={TrainingProgram.programId}"> Populate <a/>

but this would limit me to GET and as I mentioned before I would like POST.

Is it possible to solve it with plain HTML(missing something really trivial?)? JS solutions are also welcome, though I understand JS only on copy-paste black-box level and I don’t want people doing job for me and then effectively blaming me, unless it is really basic task to do in JS 🙂

Thank You,

  • 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-05-27T19:32:39+00:00Added an answer on May 27, 2026 at 7:32 pm

    Well, you should be able to do it by having two different forms:

     <p> ${TrainingProgram.name}</p> 
     <p> ${TrainingProgram.shortDescription}</p>
     <form method="POST" action="/someurlrequest">    
     <input value="Edit" type="submit" />  
     <input name="edit" type="hidden" value="${TrainingProgram.programId}" />
     </form>
     <form method="POST" action="/someurlrequest">
     <input value="Populate" type="submit" />
     <input name="populate" type="hidden" value="${TrainingProgram.programId}" />
     </form>
    

    More explanations:

    Basically, when you submit a form, all the inputs forms contained in the forms are sent to the action URL. So, even if you have two submit buttons in a same form, they will send the same values. As a rule of thumb, you should only have one submit button by form (except if you have more elaborate logic in Javascript).

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

Sidebar

Related Questions

It's a trivial task to find out if an object is referenced by something
I was greeted with a nasty bug today. The task is pretty trivial, all
The seemingly trivial task of selecting rows in a data frame and then ordering
I imagine this should be a pretty trivial task but using Firefox for Mac,
I thought this is a completely trivial task but it gave me some headache.
Render a WPF control to a bitmap image is not a trivial task as
When a user loads a project file into my application it can take a
Seems like a trivial task with LINQ (and probably it is), but I cannot
This seems like a trivial task, but I can't find an option to cleanly
I am trying to do a fairly trivial task however my experience is in

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.