Solved

How to place data to <Option> ?

Posted on 1998-11-30
3
149 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Search Item in Table 2 43
I'm a Human captcha checkbox 13 43
BG appearing and then disappaear after a second 8 25
aria difference 2 15
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
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 …

733 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