Solved

How to place data to <Option> ?

Posted on 1998-11-30
3
141 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
Comment Utility
<%
I = 0
Do while i <= 30
  X=TODMY(DMY(I))
%>
  <option value="<%=X%>"><%=X%></option>
<%
  I = I+1
LOOP
%>
0
 

Author Comment

by:yyjulie
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

762 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

12 Experts available now in Live!

Get 1:1 Help Now