JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old May 6th, 2004, 08:21 AM
prams prams is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 1 prams User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post Listbox/Menu value problem

Hi all,
I have a date selector in my asp page as Year, Month and day.
These 3 List/Menu gets populated with respect to each other, i.e., when a particular year in the first and a month in the second is selected, the dates for that year and month are populated into the third list box (named days). Everything is working fine but only the dates are been populated not the option values. I need the same date as the value in my "day" list box.

I'm using the script given below, that fills all the dates for a particular month. I feel something has to be done in the line i've boxed below. Is that at the same line or anywhere else ? And what more should be added so as fill the same dates as values ?

Please help....


function populate(objForm,selectIndex) {

timeA = new Date(objForm.year.options[objForm.year.selectedIndex].text, objForm.month.options[objForm.month.selectedIndex].value,1);
timeDifference = timeA - 86400000;
timeB = new Date(timeDifference);
var daysInMonth = timeB.getDate();

for (var i = 0; i < objForm.day.length; i++) {
objForm.day.options[0] = null;
}

for (var i = 0; i < daysInMonth; i++) {

|===========================================|
|objForm.day.options[i] = new Option(i+1); |
|===========================================|

}
document.f1.day.options[0].selected = false;

}

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Listbox/Menu value problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway