473,289 Members | 1,923 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Javascript select box

hi
I have the following scenario..
i have a select box containing a list of times. on selecting one of them i am dispalying all the details pertaining to that selection. the list is prone to additions and hence might grow longer. So i would like the user to key in the values directly. So i have a text box and a button next to it on clicking which a dropdown appears. The user can directly enter the value in the text box or select one from the select box.I m setting the value of the text box to the value selected from the drop down in the latter case. In either cases, the value in the text box is taken for processing the request.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head><title>xyz</title>
  3. <script>
  4.  
  5. function toggle(me){
  6.         if (me.style.visibility=="hidden"){
  7.             me.style.visibility="visible";
  8.             }
  9.         else {
  10.             me.style.visibility="hidden";
  11.             }
  12.         }
  13.  
  14.  
  15. </script>
  16. </head>
  17. <body onload="javascript:document.fsd.search.style.visibility = 'hidden'">
  18. <br><br><br><br>
  19. <form name="fsd" method="post" action="xyz.asp" >
  20. Enter RFC &nbsp;<input type="text" name="rfcname">&nbsp;<input type="button" title="Click to select a RFC" value="+" onclick="toggle(document.fsd.search)">&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="Search">
  21. <br>
  22. &nbsp;&nbsp;&nbsp;&nbsp;
  23. <select name="search" style="width:140px;" onchange="javascript:document.fsd.rfcname.value = document.fsd.search.options[document.fsd.search.selectedIndex].value;document.fsd.search.style.visibility='hidden'">
what i would like to have is to make the list expand and contract on clicking the '+' button or someother work around to have the user enter the value or select from the dropdown.

thanks,
ramya
Jan 9 '08 #1
1 2745
acoder
16,027 Expert Mod 8TB
To expand and contract, use style.display="block" and style.display="none" instead.
Jan 9 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
1
by: bin_P19 P | last post by:
the code i have got is as follows and now im stuck <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Shopping...
3
by: Richard | last post by:
I have tried to create a javascript puzzle where by the grid is filled with numbers from 1 to 26 and another grid listed 1 to 26 where each number relates to a letter. Once you figure out the...
9
by: beguigne | last post by:
Below is a snippet of a crude date picking routine for a form. I am a novice at this so, I am hitting my head at why when I select the day, the onChange event gives me a blank. What am I missing?...
6
by: Steve B. | last post by:
Hello everybody In a webpage, I use JS display data from an xml file and a xsl file: var data = new ActiveXObject("Microsoft.XMLDOM"); data.async = false; var dataUrl = "data.aspx";...
3
by: bloc | last post by:
I am programming an interactive CV using xml, xslt and java script. The page consists of a header which contains links to various 'sections' on the xml cv, a left and right menu, and a central...
24
by: firstcustomer | last post by:
Hi, Firstly, I know NOTHING about Javascript I'm afraid, so I'm hoping that someone will be able to point me to a ready-made solution to my problem! A friend of mine (honest!) is wanting to...
13
by: monomaniac21 | last post by:
hi i want to be able to trigger a javascript style popup alert in php (i want a message displayed on the actual page) is this possible?
4
by: Adam Smith | last post by:
Hello, How can I call or trigger an external javascript twice in a form? I have <script language="JavaScript" src="country_state.js" name="Country_State"> <script type="text/javascript"...
3
by: Venturini | last post by:
I am trying to put together a web page where the customer makes choices of products and is then given a total. I am extremely new to Javascript and have managed to get as far as I have from web...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.