Solved

How to place data to <Option> ?

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
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.…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

691 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