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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:40:09+00:00 2026-05-22T21:40:09+00:00

In a Struts 1.x application, I have a form with a simple single-selection html:select

  • 0

In a Struts 1.x application, I have a form with a simple single-selection html:select element. I want to force the user to touch the box and make a choice, rather than allowing the first option to be the de facto default value. An obvious first step is to add a stand-in html:option value as the first item in the list. This option would have a label such as “Please choose…” and a marker value of some kind to indicate that this is not a genuine option.

My question: What is the best approach to detect and reject this “no selection” value during form submission?

Ideally, I would like to use a standard Struts validator and the standard error flow, so that this would act in a similar fashion to an html:text with a “required” validator. Is this possible? If not, how can I achieve a similar effect?

  • 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-22T21:40:10+00:00Added an answer on May 22, 2026 at 9:40 pm

    You could simply have the Please choose... option have value="" then make the field required in your validation.

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

Sidebar

Related Questions

I have a Struts application and I build by form <html:form action=companyProvAdd> ....</html:form> which
I am developing a web application using Struts 2.1.2 and Hibernate 3.2.6.GA. I have
I have a struts2 application with a single page that may show one of
I'm building a simple web application that handles a simple database using struts and
I have a JSP struts application that uses Spring to integrate with the services/dao/database.
I have a j2ee web application running on struts. I am using validation XMLs
This is for a web application using struts. I have an array of objects
It's a Struts application. I have to show some dynamic date in the left
I've got a simple Struts 2 application that I build and deploy to glassfish
Trying to work with multiple submit buttons within a single form in struts2 application

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.