HTML - List Menu And Text Box Javascript
I have been looking everywhere for code for this.
What i have is a list menu where the user will select an item, then i want something to appear in the text box below it, depending on what is selected. I have been looking for 'if statements' but i cant get anything to work. e.g. if the list box "test" is selected then the text box should say "test1". if the list box "test2" is selected then the text box should say "test2" Please can someone help me out. Thanks Similar TutorialsHello everyone, I just registered on here because for the past 2 or 3 hours straight I have searched the internet madly for a solution to what I believe to be a simple problem. I'm using Dreamweaver for another site I'm doing and all i want to do is have a list menu with 3 or 4 options. Once one of those options is selected, have the label, text area or whatever down below, to display/change it's text. Whether it be loaded from an xml file, reveal a hidden text area or something. It's an musician's site for the lyrics page. So for example, Choose Album in the list, Choose Song in second list (would be nice if this changed correpsonding to the album chose) and then display lyrics below. I have to be retarded not to find this. I've looked through these forums as well and the only one close to what I am wanting seemed to be http://www.htmlforums.com/html-xhtml...enu-72789.html But the site he links to is not very friendly or helpful. In the past I've done (button onclick imgbox1.src='x') but haven't done text before. I don't know if using a label or what is best for this since I want to use the same font. Would label1.value need to change? Or label1.text... I just don't know. My apologies for the ignorance.. So if anyone in this world can assist in any way you would be MORE than appreciated! Thanks for all who view this.. -cbkyro I need to have a List/Menu Box that causes a specific set of Text fields to appear. Their for Intl. Telephone Dialing Protocols. Code: Country: <select name="Country" class="textfieldRequiredState" id="Country"> <option selected="selected">Select One</option> <option value="U.S.A.">U.S.A.</option> <option value="England">England</option> </select> </p> <p> <input name="USA Area Code" type="text" id="USA Area Code" maxlength="3" width="35" minlength="3" size="1" /> - <input name="USA Prefix" type="text" id="USA Prefix" minlength="3" maxlength="3" width="35" size="1" /> - <input name="USA Line Number" type="text" id="USA Line Number" minlength="4" maxlength="4" width="35" size="1" /> (U.S.A.: 3-3-4 Digits) </p> <p> <input name="England Area Code" type="text" id="England Area Code" maxlength="4" width="35" size="1" /> - <input name="England 1" type="text" id="England 1" maxlength="3" width="35" size="1" /> - <input name="England 2" type="text" id="England 2" maxlength="3" width="35" size="1" /> (England: Up to 4 then 3-3 Digits) </p> <p>If option value is "U.S.A." then display Textfield "USA Area Code", Textfield "USA Prefix", Textfield "USA Line Number" at "x" "y" coordinates. Hey there, I'm new to the forums, and never really asked for help on a site before, but I'm stuck. Basically, i have a client that needs an automated way to send forms for bookings online. So far, i have created a basic HTML page that the client can import > as text in Outlook and the html gets placed into the Email. This works fine, as the user can fill out the form and reply back to us. The problem happens when i add the following code: Code: <select name="accomodation"> <option value="" selected="selected">Please Select</option> <option value=""> -------------------------- </option> <option value="32">1 Bedroom Studio</option> <option value="41">1 Bedroom Spa</option> <option value="48">1 Bedroom Deluxe Spa</option> <option value="39">2 Bedroom Spa</option> <option value="42">2 Bedroom Deluxe Spa</option> <option value="45">3 Bedroom</option> <option value="46">Houses / Cottage</option> </select> Now this code works when originally inserted into the email, i can make a selection and email it away, and the selection stays and is visible when opened. But once the email is sent, any further changes (a reply back, forward etc.) will break the drop down and just splatter the list in my table. Is there any way to correct this? any other option of code i could use or a setting i can use to stop the break? Help would be greatly appreciated. Thanking you, Evan. Hi, I have a bit of a problem. I am learning HTML and CSS, and I am trying to make a simple menu withh a background button up state and a horizontal unordered list across, with a hover effect of a new bg image over the initial ones. Please help! Thanks in advance. Hi, I've got a html/css sIFR menu made as a List. The problem is that in various browsers (FF2, Sfr3, IE5-7) the actual (sIFR) text pixels are in FF and IE unclickable and in all of the browsers the area won't show up Pointer cursor when moving the cursor above a sIFR link. For the latter, I've tried "cursor: pointer" on CSS but I couldn't have yet seen the hoped results. Anyone experienced with sIRF links? How could this be solved up? Thank you. Hi all, [LINK REMOVED] Just in the process of changing this website from a black layout with a background to an all white layout... I'm wishing I had started from scratch now but I stupidly tried to work with the existing site. So anyyways you can ignore the crappy looking bits because my question is just about the menu bar at the top... It's made from an inline list. Is there any way that I could spread it out across the screen, so that the menu item on the right is hard up against the right? The other thing is that the site will be in 3 or 4 languages so the menu items will have more characters in Spanish (for example). It needs to be able to adapt, or I need to implement a different solution for each language. The html looks like this: Code: <!-- main navigation --> <ul id="nav"> <li class="home"> <a href="index.htm"><span>Home</span></a> </li> <li> <div> <ul> <li><a href="message-from-director.htm">Message From Director</a></li> <li><a href="what-is-15-15.htm">What is 15/15?</a></li> <li><a href="festival-history.htm">Festival History</a></li> <li><a href="judges-special-guests.htm">Judges & Special Guests</a></li> </ul> </div><a href="#"><span>About 15/15</span></a> </li> <li> <div> <ul> <li><a href="register-now.php">Register Now</a></li> <li><a href="get-ready.htm">Get Ready</a></li> <li><a href="conditions-of-entry.htm">Conditions of Entry</a></li> <li><a href="faq.htm">FAQ</a></li> </ul> </div><a href="#"><span>How To Enter</span></a> </li> <li> <div> <ul> <li><a href="screening-information.htm">Screening Information</a></li> <li><a href="nominations.htm">2009 Nominations</a></li> </ul> </div><a href="#"><span>Programme</span></a> </li> <li> <div> <ul> <li><a href="films.htm">Films</a></li> <li><a href="festival-trailers.htm">Festival Trailers</a></li> </ul> </div><a href="#"><span>Archives</span></a> </li> <li> <div> <ul> <li><a href="festival-sponsors.htm">2009 Festival Sponsors</a></li> </ul> </div><a href="#"><span>Sponsors</span></a> </li> <li> <div> <ul> <li><a href="press-releases.htm">Press Releases</a></li> <li><a href="images.htm">Images</a></li> </ul> </div><a href="#"><span>Newsroom</span></a> </li> <li class="contact"> <div> <ul> <li><a href="contact-us.php">Contact Us</a></li> <li><a href="15-15-committee.htm">15/15 Committee</a></li> </ul> </div><a href="#"><span>Contact</span></a> </li> </ul> ...and the CSS looks like this: Code: #nav { font-size: 15px; line-height: 20px; list-style: none; padding: 0; position: absolute; top: 250px; left:-5px; width: 750px; } #nav li { display: inline; float: left; margin: 0 0 0 0px; position: relative; } #nav a { color: #000; float: left; text-decoration: none; } #nav a span { cursor: pointer; float: left; display: inline; font-weight: bold; line-height: 30px; padding: 0 5px; } #nav li.hover a, #nav li:hover a { background: url(../img/active-l.gif) no-repeat 0 0; } #nav li.hover a span, #nav li:hover a span { background: url(../img/active-r.gif) no-repeat 100% 0; } #nav .contact div { background: #D3D2D2 url(../img/bg-bg-t2.gif) no-repeat 0 -1px; left: auto; right: 0; } * html #nav .contact div { right: -1px; } #nav div { background: #D3D2D2 url(../img/bg-bg-t.gif) no-repeat 0 -1px; display: none; left: 0; padding: 5px 0 0; position: absolute; top: 30px; width: 168px; z-index: 100; } #nav li.hover div, #nav li:hover div { display: block; } #nav div ul { background: url(../img/bg-b.gif) no-repeat 0 100%; list-style: none; margin: 0; overflow: hidden; padding: 0 0 5px; text-transform: none; width: 168px; } #nav div ul li { margin: 0; padding: 0; width: 168px; } #nav li.hover div ul li a, #nav li:hover div ul li a { background: none; color: #000; display: block; line-height: 30px; padding: 0 0 0 9px; width: 159px; } #nav li.hover div ul li a:hover, #nav li:hover div ul li a:hover { background: #D9581F; } Any ideas? Thanks so much in advance... Neil Hi All, first post in the forum. I would like to know if it is possible to create a drop down list from which the user could select a value but could also decide to enter a new one ? What I want is to offer the user to select an existing company name or enter a new one, but I would like to have only one field to do it instead of two. Is this possible Thanks for helping. ALex Hi, I have a text box, when i press M ,it must populate a list of names that start with so that user can select any one of the name.on the selection of the name,it must appear in text box. In a short it must work like google search engine. Can any one provide me guide lines in this task Thanks & Regards in Advance Hi, I'm learning about horizontal lists. I'm trying to position a string ("Stuff" in the code snippet) a given distance (say 100px) to the right of the last item in a horizontal list, on the same line as the list. How do I do this? The following code snippet, using CSS for the UL and LI tags with a WIDTH specification for the UL tag, results in a BREAK between the last list item and the string "Stuff", as shown below: ------------------------------------------------------------------------------------------------------- Books Posters Stuff. ------------------------------------------------------------------------------------------------------- Code Snippet: Code: <HTML> <HEAD> <STYLE> li { float: left; padding-right: 32px; padding-left: 32px; } ul { list-style-type:none; width=300; } </STYLE> </HEAD> <BODY> <UL><LI>Books</LI><LI>Posters</LI></UL> Stuff. </BODY></HTML> In fact the only way to not have a BREAK between the last list item and the string "Stuff" is to remove the WIDTH specificaton from the UL tag altogether, but then the string "Stuff" cannot be positioned a given distance to the right from the last list item--it just goes the default distance. So how can text trailing a horizontal list be positioned a specific distance to the right of the horizontal list on the same line? Thanks very much for any help you can provide. Thanks, Dave Hi there, I'm new to this forum; got here researching the best method to do a task in HTML dealing with ordered lists. Basically I'm trying to figure out the best method to have the word "Step" precede the number in an ordered list, so that <ol> <li>first line of text</li> <li>next line of text</li> <li>last line of text</li> </ol> would return Step 1. first line of text Step 2. next line of text Step 3. last line of text I know how to do this using background images with CSS, but that isn't ideal because any formatting changes to the text would require making a new gif or jpg for the word "step." Does anyone know how to do this? Thanks for your help! HI, The following code HTML Code: <SELECT NAME="TEST"> <OPTION>TEST TEST</OPTION> </SELECT> renders an option with 'TEST TEST'. Even though there are more than 1 white spaces, only single white space is given. How can I over ride this default behavior? Thanks in advance, Chandu. i want to make appear in a text box an item from a list box when i choose what item i want. <select size="1" name="s1" class="clsSelect"> <option selected="selectd">cod_artigo</option> <option>desig_art</option> <option>pr_compra</option> <option>num_enc</option> <option>mda</option> <option>quantidade</option> <form name="1" action="condicao1.php" method="post"> <textarea cols="55" rows="4" name="txt2"></textarea> </form> Please help me! xD im a noob xD I would like to create a hierarchical text menu for my site, that does not require me to have a different menu for each page. I am currently creating UL's for each page then adding that to the page to display the menu. Example: Creating page called "Sidebar.htm", adding a UL, then using webbot to add that page to the home page: <ul> <li><a href="foundationvents.htm">Automatic Foundation Vents</a></li> <!---<li><a href="#">Home Insulation</a></li> <li><a href="#">Security Systems</a></li> ---> <li><a href="waterheaters.htm">Tankless Water Heaters</a></li> <!---<li><a href="#">Home Windows</a></li>---> </ul> I then create another page called "Sidebar1.htm", and proceed to do the same thing for the next page: <ul> <li><a href="foundationvents.htm">Automatic Foundation Vents</a></li> <!---<li><a href="#">Home Insulation</a></li> <li><a href="#">Security Systems</a></li> ---> <li><a href="waterheaters.htm">Tankless Water Heaters</a></li> <ul> <li><a href="waterheaters1.htm">How do they work?</a></li> <li><a href="waterheaters2.htm">How much can I save?</a></li> </ul> <!---<li><a href="#">Home Windows</a></li>---> </ul> There has got to be an easier and more organized way to create a hierarchical text menu and I would appreciate any suggestions about how to do it. Thanks, Chuck Hello, I have a drop down menu where one of the items is EXTREMELY long, and because of this, the overall size of the drop down box is the size of this item. I found a way to shrink the size of the drop down box via: <style type="text/css"> select {height: 12px; width: 50px; max-height: 12px} </style> This works in shrinking the overall size, but what happens is that the really long item is now longer than the width of the box and the text for the item doesn't wrap around down to the line below. So you don't actually see the whole item in the list. Do you know how I can wrap this item so that the text falls down to the line below? Cheers i would like to allow surfers to access sections of my website directly from the google.com search page here is a example of what i would like to do Hi, I am using css to create a dropdown menu. It works fine in all browsers except IE6. In IE6 a dropdown list covers the dropdown menu. please see the atachment/screenshot. Here is the html/css code I am using. HTML Code: { position: relative; z-index: 1;}*/ ul.dropdown, ul.dropdown li, ul.dropdown ul { list-style: none; margin: 0; padding: 0; } ul.dropdown { position: relative; z-index: 597; float: left; } ul.dropdown li { float: left; line-height: 1.3em; vertical-align: middle; zoom: 1; z-index: 599; } ul.dropdown li.hover, ul.dropdown li:hover { position: relative; z-index: 599; cursor: default; } ul.dropdown ul { visibility: hidden; position: absolute; top: 100%; left: 0; z-index: 598; width: 100%; } ul.dropdown ul li { float: none; z-index: 598; } ul.dropdown ul ul { top: 1px; left: 99%; z-index: 598; } ul.dropdown li:hover > ul { visibility: visible; z-index: 598; } HTML Code: <div id="header" class="header" style="background-image: url(./images/blue-curve.jpg); background-position: top;"> <h1> Finance and Risk </h1> <ul class="dropdown dropdown-horizontal noPrint"> <li><a href="#" class="dir">Data Management</a> <ul> <?php echo '<li><a href="main.php?PageName=import3' . SID . '">Upload Data</a></li>'; ?> <?php echo '<li><a href="main.php?PageName=list' . SID . '">Download Data</a></li>'; ?> <?php echo '<li><a href="main.php?PageName=delete' . SID . '">Delete Data</a></li>'; ?> <?php echo '<li><a href="main.php?PageName=assetupdate' . SID . '">Update Data</a></li>'; ?> </ul> </li> <li><a href="#" class="dir">Reports</a> <ul> <?php echo '<li><a href="main.php?PageName=reports' . SID . '">BS Overview</a></li>'; ?> <?php echo '<li><a href="main.php?PageName=CDO' . SID . '">CDOs</a></li>'; ?> <?php echo '<li><a href="main.php?PageName=impairment' . SID . '">Impairments</a></li>'; ?> <?php echo '<li><a href="main.php?PageName=fvecapreport' . SID . '">FairValue and Risk</a></li>';?> <?php echo '<li><a href="main.php?PageName=creditrisk' . SID . '">Credit Default Risk</a></li>';?> <?php echo '<li><a href="main.php?PageName=securitydata' . SID . '">MarketData</a></li>';?> </ul> </li> <li><a href="#" class="dir">Files & Manuals</a> <ul> <?php echo '<li><a href="magnitude.pdf" target="_blank">Product Codes</a></li>';?> <?php echo '<li><a href="uploadmanual.pdf" target="_blank">Upload Manual</a></li>';?> <?php echo '<li><a href="main.php?PageName=osmdocs' . SID . '">OSM Files</a></li>'; ?> </ul> </li> <li><a href="#" class="dir">Miscellaneous</a> <ul> <?php echo '<li><a href="main.php?PageName=creditcrises' . SID . '">Credit Crises</a></li>'; ?> </ul> </li> <?php if ($_SESSION['Admin'] == "Yes") { ?> <li><a href="#" class="dir">Admin </a> <ul> <?php echo '<li><a href="main.php?PageName=message' . SID . '">Flash Alerts</a></li>'; ?> <?php echo '<li><a href="testmarcel1.php?' . SID . '">Test Marcel1</a></li>'; ?> <?php echo '<li><a href="testmarcel2.php?' . SID . '">Test Marcel2</a></li>'; ?> <?php echo '<li><a href="testmarcel3.php?' . SID . '">Test Marcel3</a></li>'; ?> <?php echo '<li><a href="main.php?PageName=testajay1' . SID . '">Test Ajay1</a></li>'; ?> <?php echo '<li><a href="testajay2.php?' . SID . '">Test Ajay2</a></li>'; ?> <?php echo '<li><a href="testajay3.php?' . SID . '">Test Ajay3</a></li>'; ?> </ul> </li> <?php } ?> <li><a class="dir" href="main.php?PageName=menu">Menu</a> <ul> <?php echo '<li><a href="logout.php">Logout</a></li>'; ?> <?php echo '<li><a href="#">Change password</a> </li>'; ?> </ul> </li> <li><a class="dir" href="javascript:window.print()" color="green">Print</a> </li> </ul> </div> Any one has an idea how to get the css menu on top of the dropdown list? Thanks in advance Hi, I am creating a form in which i have a dropdown menu. According to the selection(s) in drop down menu, that many text field(s) should be shown below that drop down menu. Have a look at this code... <html> <head> <title> Sample Application </title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script> function callMe() { if(document.MyForm.dropDownValue.value != ""){ document.getElementById("txtBox").style.visibility = "visible"; } else{ document.getElementById("txtBox").style.visibility = "hidden"; } } </script> </head> <body> <form name="MyForm"> <table> <tr> <td> <select name="dropDownValue" onchange="callMe();"> <option value="">--None--</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </tr> <tr id="txtBox" style="visibilty:visible"> <td> Enter Your Value He </td> <td> <input type="text" name="txtEntry" value=""> </td> </tr> </table> </body> </html> : the problem is: when I select 2, it suppose to show 2 text fileds and 3 when i select 3 accordingly. I am new to this stuff...so,can any one help me out ASAP pls?? thanks , i will be waiting for your reply... -S Hi Folks, I've created a drop down menu and what I want is when the mouseover event is fired to post a small explanation of the currently selected item. I managed to get it working with buttons, but not with the drop down menu. Here is a snippit of my code: ... <SCRIPT LANGUAGE="JavaScript"> function profile( form ) { form.Instructions.value = "Profile selected" } function employees( form ) { form.Instructions.value = "Employees"; } function menu( form ) { form.Instructions.value = "Menu"; } </SCRIPT> </HEAD> <BODY> <FORM NAME="myotherform" ACTION="" METHOD="POST"> <select name="Admin Dropdown" style="width:250px"> <option value="Profile" onmouseover="profile( this.form );" />Edit Profile</option> <option value="Employees" onmouseover="employees( this.form );" />Edit Employees</option> <option value="Menu" onmouseover="menu( this.form );">Update Menu</option> </select> <textarea value="Instructions"></textarea> </FORM> </BODY> </HTML> </HTML> If I print raw text then the functions will work but it doesn't work when I invoke some manipulation on the form itself. Is this doable? And if so, what am I missing? Thanks! Hey guys I am build ing a site and wanted to no the best solution for a drop down menu system. I read somewhere that 10% of people of javascript disabled so they would not be able to use the javascript dropdown. Is the best option to use dhtml for this so it will work in all browsers old and new. Matt I need my css menu to stay on top of everything, but there is a .swf with a javascript code that I am using for a slideshow that won't stay under the menu. Any solutions? - THANK YOU! Here's the test page: http://dbk.me/test/intro.html RESOLVED! - Used variable: so.addParam("wmode", "transparent"); Thanks for your help! |