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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:46:43+00:00 2026-05-13T17:46:43+00:00

this is my code <html:select property=singleSelect> <html:option value=0>Select One </html:option> <script type=text/javascript> var nfhEvents

  • 0

this is my code

<html:select property="singleSelect">
<html:option value="0">Select One </html:option> 
<script type="text/javascript">
var nfhEvents =new Array();
<% ArrayList nfhList = simple.Reject();
String[] stringArray = (String[])nfhList.toArray(new String[nfhList.size()]);
System.out.println("Size   "+stringArray.length);%>
var state = new Array(<%= stringArray %> );
for (int i = 0; (i < <%= stringArray.length%>); i++) {
    document.write("<option value='"+state[i]+"'>" + <%= stringArray[i]%>+"test" +"</option>");
}
</script>
   this is not working fine. how to print values one by one in the option. pls help asap
<html:select>
  • 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-13T17:46:43+00:00Added an answer on May 13, 2026 at 5:46 pm

    Here is an example of what I did with the calendar month (in javascript)

    <select name="birthMonth"><option value="-1">-&nbsp;Month:&nbsp;-</option>
        <script type="text/javascript">
        var monthStr = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November","December");
    
            for (var i = 0; i < 12; i++) {
                if (i != 8) {                                           
                  document.write('<option value="' + (i + 1) + '">' + monthStr[i] + '</option>');
            } else {
                  document.write('<option value="' + (i + 1) + '" selected>' + monthStr[i] + '</option>');
            }
           }
        </script>
    </select>
    

    I hope this helps you.

    EDIT: Since you’re using Struts

    <html:select property="singleSelect">
    <html:option value="0">Select One </html:option> 
    <% ArrayList nfhList = simple.Reject();
    String[] stringArray = (String[])nfhList.toArray(new String[nfhList.size()]);
    //You MUST do this
    request.setAttribute("stringArray", stringArray);
    %>
    <logic:iterate id="s" name="stringArray">
      <html:option value="${s}"><bean:write name="s" /></html:option>
    </logic:iterate>
    </html:select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK i have this code HTML: <html> <head> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js> </script> <script type=text/javascript>
I have this code: @Html.DropDownList(ddlCouponsAppointment, Model.Coupons.Select(a => new SelectListItem { Text = a.Name, Value
<html:select property = abc> <c:forEach var=abcSearch items=${requestScope.abcSet}> <html:option value=<c:out value='${abcSearch}'/>><c:out value='${abcSearch}' /></html:option> </c:forEach> </html:select>
I have this HTML code for radios: <input type='radio' name='a_27' value='Yes' id='a_27_0' /> <input
Below is my code: <%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> <%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> <script type="text/javascript"> var flag
I have this HTML code which simulates a dropdown multi-checkbox <div> <div class=select> <span>Select
This code gets html data and should replace all javascript content $.ajax({ url: url,
This code on an html page comes in as one line. Why isn't backslash
Given this html: code I'd like a selection of b in Select d1 to
This is my code: <?php $q=$_GET[q]; require(../db.php); $res_prop_name = mysql_query(select * from property where

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.