Solved

How to place data to <Option> ?

Posted on 1998-11-30
3
147 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

832 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