Solved

How to place data to <Option> ?

Posted on 1998-11-30
3
146 Views
Last Modified: 2010-04-09
i have a list box shows future working days that retrieved from database.  Since the date format originally in MDY, so i change it to DMY before i place it to the list box.  However, it doesn't work as i expected, it only shows "X" in the list box but not the value of X.

What can I do?
The code is listed as follows:-

<%SQLQUERY = "SELECT * from ehkholiday where datediff(dd,getdate(),date) between 0 and 30"
set RSTitleList = myConnection.Execute(SQLQuery)%>

    <tr><td>Date:</td>
      <td><select NAME="DATE" size="1">

Dim DMY (31)
I = 0
<% Do While not RSTitleList.eof%>
   DMY(I) = (<%=RStitleList("date")%>)
       I  = I + 1
<%RSTitleList.MoveNext%>
<%Loop%>

I = 0
Do while i <= 30
   X=TODMY(DMY(I))
   <option>value="X" </option>
   I = I+1
LOOP



</select>
0
Comment
Question by:yyjulie
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 50 total points
ID: 1840101
<%
I = 0
Do while i <= 30
  X=TODMY(DMY(I))
%>
  <option value="<%=X%>"><%=X%></option>
<%
  I = I+1
LOOP
%>
0
 

Author Comment

by:yyjulie
ID: 1840102
I can't get an expected result, it only shows me the text but not list into the list box.

Dim DMY (31) I = 0 DMY(I) = (12/1/98) I = I + 1 DMY(I) = (12/2/98) I = I + 1 DMY(I) = (12/3/98) I = I + 1.......
0
 
LVL 28

Expert Comment

by:sybe
ID: 1840103
If you use Netscape, you must place form elements between the form tags.

So put the whole code between <form> and </form>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now