Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Development

Pulling data from a pulldown

Author Message
Jon



Joined: 30 Aug 2007
Posts: 1

Posted: Thu Aug 30, 2007 - 2:12 pm    Post subject: Pulling data from a pulldown Reply with quote

I am moding a stock RSS widget from Dashcode and it currently has this snippet of code...hard coded by some prefs in dashcode

Code:

var attributes = {
    feedURL: "",
    numItemsToShow: "-1",
    maxAgeToShow: "-1",
    showDate: "1",
    showUpdateBadge: '1'
};


What I need is for that attributes.feedURL part to take input from a pull down menu with predefined URLs


Any ideas or resources?

Thanks
Jon
View user's profile Send private message Send e-mail Visit poster's website AIM Address Widgets
Greenie



Joined: 08 Jun 2005
Posts: 81

Posted: Fri Aug 31, 2007 - 2:50 am    Post subject: Reply with quote

Hi,

hmm, maybe I don't see where the actual problem lies, but if you just want to set "attributes.feedURL" from a selectlist/pulldownmenu-entry, you can do something like this (let's say, your pulldown-menu has an id of "myPulldown"):

Code:
var myMenu = document.getElementById("myPulldown");
var myIndex = myMenu.selectedIndex;
if (myIndex != -1){   // just for safety, test if an option is chosen
   attributes.feedURL = myMenu.value;   // shortcut to value of selected option
   // alternatively, if the url is the displayed text, not the value
   // attributes.feedURL = myMenu.text;
}
View user's profile Send private message Send e-mail AIM Address ICQ NumberWidgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group