•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 455,974 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,807 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1523 | Replies: 2 | Solved
![]() |
•
•
Join Date: Nov 2007
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
The following code snippet works in IE, but not Firefox 2.0.0.10. The parts that access text boxes work great. I can see the selectedIndex's value for the two drop-downs, but cannot retrieve the text of the selected item for either drop-down. Specifically, the first alert displays the value of the URL string to that point. The second alert doesn't display.
I would really appreciate any help with this one!
var URL = "http://www.rms4sd.com/media_and_resource_center/dev/inputResource.pl?date=" + document.data_entry.date.value;
URL += "&title=" + document.data_entry.media_title.value;
URL += "&URL=" + document.data_entry.URL.value;
alert(URL);
URL += "&topic=" + document.data_entry.topic.options(document.data_entry.topic.selectedIndex).text;
URL += "&format=" + document.data_entry.format.options(document.data_entry.format.selectedIndex).text ;
alert(URL);
I would really appreciate any help with this one!
var URL = "http://www.rms4sd.com/media_and_resource_center/dev/inputResource.pl?date=" + document.data_entry.date.value;
URL += "&title=" + document.data_entry.media_title.value;
URL += "&URL=" + document.data_entry.URL.value;
alert(URL);
URL += "&topic=" + document.data_entry.topic.options(document.data_entry.topic.selectedIndex).text;
URL += "&format=" + document.data_entry.format.options(document.data_entry.format.selectedIndex).text ;
alert(URL);
Read this.
As far as your problem is concerned,
The above way of referencing form elements is pretty inefficient and partly incorrect which is what the tutorial I posted aims at explaining.
As far as your problem is concerned,
document.data_entry.topic.options(document.data_entry.topic.selectedIndex).text; should be document.data_entry.topic.options[document.data_entry.topic.selectedIndex].value ;The above way of referencing form elements is pretty inefficient and partly incorrect which is what the tutorial I posted aims at explaining.
I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
ajax asp beta bon browser browsers browsing c++ developer development echo email encryption europe firefox gecko home html internet internet explorer internet explorer 7 javascript leak linux memory microsoft mozilla msdn networking news object office open source open-source oriented patch phishing planning programming scams security site software sql super testing users vista web webmail
- Javascript Firefox Help (JavaScript / DHTML / AJAX)
- Onactivate event not working for flash object in firefox (JavaScript / DHTML / AJAX)
- Opera Javascript bug? (works in Firefox) (JavaScript / DHTML / AJAX)
- Hmm... Javascript error, or Mozilla stupidity? (JavaScript / DHTML / AJAX)
- javascript works in IE but not working in firefox (JavaScript / DHTML / AJAX)
- I hate Firefox! (JavaScript / DHTML / AJAX)
- Error reading XML file in Javascript (JavaScript / DHTML / AJAX)
- Sending audio data over HTTP problem (Java)
- hover over text tips (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Javascript Problem help me
- Next Thread: How to make controls visible false using javascript...?



Linear Mode