Developing web applications in Struts 1.3.
So there's something I want to do.
Here's what I want to do:
1. Use the select box on the form screen (JSP) to display the value from DB.
2. Display some of the values in the select box when selected, and
Display values that you do not want to display in a different text box
Example 0002▽ (BBB should not be displayed)
BBB (←text box)
The above 1 process has been accomplished, but
2 has not been processed.
If anyone knows more,
I look forward to hearing from you.
Basically, you only need to process the value selected in the change event of the SELECT element, but you need to make some effort to display it in the SELECT element.
Proposal 1: Force the width of the SELECT element.
The appropriate width depends on the font and browser, so I think it's relatively difficult to make it work in any environment.The following snippets work well with Chrome on macOS, but they may not work well in other environments.
Proposal 2:Do not use SELECT elements for display
You need to overlap the SELECT and display elements well in order to bring up the menu.
This snippet isn't very serious.
Proposal 3: No SELECT elements
With a UI library that has the same functionality as the SELECT menu, you may be able to customize the display.
© 2022 OneMinuteCode. All rights reserved.