SunQuest
           Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed 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 October 12th, 2001, 11:52 AM
Hagan.B Hagan.B is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: London
Posts: 19 Hagan.B User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Dynamic Menu with text-box option

Hi,

Im very new to javascript, and need a little help with some code.

I have a script which i downloaded from another site, which is a pull-down-menu. Depending upon what you select, a text description is shown below.

This is great, and all works fine. However, what i need to be able to do is if a user selects, say, the last option, I need to make 2 text boxes appear for data input, instead of the text description. I only need the text boxes for 1 of the options.

Any help with this would be very much appreciated.

Regards, Ben.

Heres the code so far:-


<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">


<form name="a294" >
<select name="a969" size="1" style="background-color:#FFFFD7" onChange="displaydesc(document.a294.a969.selectedIndex)">
<option selected value="http://wsabstract.com">Website Abstraction </option>
<option value="http://freewarejava.com">Freewarejava.com</option>
<option value="http://wired.com">Wired News</option>
<option value="http://freewarejava.com/cgi-bin/Ultimate.cgi">WA Help Forum</option>
<option value="http://www.msnbc.com">MSNBC</option>
</select>
<input type="button" value="Go"
onClick="location=document.a294.a969.options[document.a294.a969.selectedIndex].value"><br>
<span id="descriptions" align="left" style="font:italic 13px Arial">
</span>
</form>

<script>

var textdisplay=new Array()
textdisplay[0]="Comprehensive JavaScript tutorials and over 400+ free scripts"
textdisplay[1]="Direct link to hundreds of free Java applets online!"
textdisplay[2]="Up to date news on the technology front"
textdisplay[3]="Interact with other webmasters on JavaScript, DHTML, and more."
textdisplay[4]="National and international news"

function displaydesc(which){
if (document.all)
descriptions.innerHTML=textdisplay[which]
else if (document.getElementById)
document.getElementById("descriptions").innerHTML=textdisplay[which]
}

displaydesc(document.a294.a969.selectedIndex)

document.a294.a969.options[0].selected=true

</script>

</body>
</html>

Reply With Quote
  #2  
Old October 13th, 2001, 12:11 AM
sLiPkNoT rUlEz sLiPkNoT rUlEz is offline
PHP Coder
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Ontario
Posts: 66 sLiPkNoT rUlEz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to sLiPkNoT rUlEz Send a message via AIM to sLiPkNoT rUlEz Send a message via Yahoo to sLiPkNoT rUlEz
Uh... what does this have to do with Servlets & JSP?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Dynamic Menu with text-box option


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 | 
  
 





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