Dropdown Menu Hide Or Show Content Based On Selection

Nov 26, 2009

I'm pretty bad with Javascript, but I need to hide or show a snippet of text (could be inside a div without problems) based on the selection of a dropdown menu (<select>). If they choose anything with the word "Series" on it, I need to show the snippet. If they choose anything without "Series" on it, then the snippet needs to disappear. I should mention the snippet is part of a form, just a checkbox but that shouldn't be a problem I don't think.

View 24 Replies


ADVERTISEMENT

JQuery :: (.) Period In Value Field - Show/hide A Div Based Based On The Selection Made Via A Dropdown

Apr 9, 2010

Im using a jQuery script to show/hide a div based based on the selection made via a dropdown.

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>

The problem im having is that the value used in the dropdown lists are price values eg 10.00

Consequently jQuery seems to interprit these as css notations, meaning the code doesnt work.

View 4 Replies View Related

Appear / Disappear Text Box Based On Selection Of Dropdown Menu

Apr 12, 2011

I have a Javascript function that allows the display of a textbox upon selecting an option from a dropdown menu. In my case when a user selects listbox as the option, the text box appears. I want the same thing to happen when another option (checkbox) is selected. when I repeat the JAVAscript code, the first textbox(listbox's textbox) appears irrespective of which option(listbox, checkbox) I select. I want to be able to appear/disappear only the respective textbox. Here is my code.

<html>
<script type="text/javascript" >
function showfield(name){
if(name=='lstbox')document.getElementById('div1').style.display="block";
else document.getElementById('div1').style.display="none";
}
function hidefield() {
[Code]....

View 2 Replies View Related

Populate Checkboxes Based On The Dropdown Menu Selection?

Jun 29, 2011

how to populate checkboxes based on the dropdown menu selection

View 2 Replies View Related

Disable Text Field Based On Dropdown Menu Selection

Feb 18, 2009

I have a simple form - I want to disable the text field if Choice 2 from the dropdown menu is selected. I have this working with the code below, but for some reason if I go back and select choice 1 after selecting choice 2 the text field remains disabled. I only want it to be disabled if choice 2 is selected.

View 5 Replies View Related

Show/Hide Buttons Based On Radio Selection

Jul 20, 2005

I have a form with three radio options. And I have three buttons:

<input type="submit" name="mainform_action" value="Edit Data">
<input type="submit" name="mainform_action" value="View Data">
<input type="submit" name="mainform_action" value="Delete Data">

If the first radio button is selected, I only want all three buttons to be
visible to the user.

If the second radio button is selected, I only want the "Edit Data" and "View
Data" buttons to be visible.

If the third radio button is selected, I only want the "View Data" button to be
visible.

Is it possible to accomplish this in Javascript? In particular, I want to
continue using the "input type=submit" buttons without having to create my own.

View 3 Replies View Related

Show - Hide Div Based On Radio Selection - Prototype

Apr 27, 2010

I have 3 divs that contain radio with labels and beneath each radio button I would like to show/hide a form based on whether the radio is selected or not.

Code idea:

So if the radio1 input is selected this would show form1. Selecting radio2 input would hide any other forms (form1, form3) and show form 2 etc.

View 1 Replies View Related

Show/hide Several Elements Based On List Selection?

Jan 26, 2009

I got a table.Each row has a list of statuses.If status == yes, then several elements will be shown in the rowif status != yes, then hide those elements.Im not sure if I have made a good solution, but it seem to work ok (opera9.6, ff2, ie7)The status selector passes on a unique rowid, and itself. This way the js function can get the row, and the status of the selection. Then toggle various elements in that row.Only annoying thing is the way row elements are named and found. It kinda have to rely on some hard coding, but its ok I guess.Im not sure if its possibel to just call toggle( this ), and that way get to the elements in the row.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

[code].....

View 7 Replies View Related

JQuery :: Making Dropdown Show / Hide Depending On Selection

Jan 10, 2011

I have the following code that generates two dropdown boxes in a form, but I would like for the second to be hidden unless the first has 'Software problem' selected. Is it possible to do this?

<p id="parent-menu">
<select name='helpdesk-category' id='helpdesk-category' class='dropdown' tabindex="40">
<option value='-1'>Select a Category</option>
<option class="level-0" value="13">Software problem</option>
<option class="level-0" value="14">Hardware problem</option>
<option class="level-0" value="15">Suggestion</option>
<option class="level-0" value="16">General query</option>
</select>
</p>

<p id="toggle-menu">
<select name='software-category' id='software-category' class='dropdown' tabindex="50">
<option value='-1'>Select a Program</option>
<option class="level-0" value="6">BigHand</option>
<option class="level-0" value="7">IRIS</option>
<option class="level-0" value="8">MS Outlook</option>
<option class="level-0" value="9">MS Word</option>
<option class="level-0" value="10">MS Excel</option>
<option class="level-0" value="11">Oyez</option>
<option class="level-0" value="12">Internet Explorer</option>
</select>
</p>

View 2 Replies View Related

Show/hide Elements Of A Form Based On Drop Down Box Selection

Feb 13, 2006

I am setting up a contact form, and want to have a drop down box with a handful of options. Clicking one option should display fields to input username & password, whereas all others will not. So far, I've tried and (replacing 'none with 'block' for the option that is supposed to show the input fields) but neither does what I need it to. I'm fairly new to javascript, just muddling my way through with the aid of tutorials.

View 2 Replies View Related

Show/Hide Text And Form Field Based On Drop Down Selection

Jul 20, 2005

I'm trying to show/hide a simple piece of text and a text field on a
form based on what choice is made from a drop down box.

<select name="dropdown" size="1">
<option selected value="">Please make a selection</option>
<option value="1">Choice 1</option>
<option value="2">Choice 2</option>
<option value="3">Choice 3</option>
<option value="4">Other</option>
</select>

i.e. if Choice 2 is selected I'd like to display a new <tr> with the
following:

<tr>
<td>New text field:</td>
<td><input name="newField" type="text size="20"></td>
</tr>

if any other choices are made, I don't want to display anything.
I've tried several onchange() functions but can't achieve what I'm
looking for.

View 6 Replies View Related

Show - Hide Based On Content Within Div

May 6, 2011

I would like to show or hide a header element (e.g. <h3></h3>) based up a div tag that either contains content or not. The content is dynamically added or shown, but the header element isn't, which results in having the header element shown with no content below it many times.

Here's an example:

View 2 Replies View Related

Show And Hide On Select Option Dropdown Menu

Jan 30, 2009

Basically, I have written an application that runs a report based on a certain amount of parameters, one of which being date. So, the date selection is a <select></select> dropdown menu and it has the usual in it, today, yesterday, this week, last week etc. The problem is I need it to have a 'Custom' selection to run reports for custom dates. When 'Custom' is selected in the dropdown menu, two text boxes appear underneath with YYYY-MM-DD watermarked in them. I have assembled enough code from around the web to get this to work and it works fine, the problem I have is that when the user clicks off the 'Custom' option and on to a different one, I need the textboxes to disappear again.

Here is the code I am using:
<script type="text/javascript">
function showhide(divid){
thediv = document.getElementById(divid);
if(thediv.style.display== 'none' ){
thediv.style.display='block'
}else{
thediv.style.display='none'
}} .....

View 3 Replies View Related

Asp.net - Show/Hide A Textbox On Select Dropdown Menu

Apr 12, 2010

How do i get a dropdown menu to hide/show a textbox and a label control ? in a asp.net page

Here is my code:

View 3 Replies View Related

Show / Hide Content Of Sub Divs Based On Whether Input Is != / =

Aug 9, 2009

how can I show / hide the content of sub divs based on whether the input is != or = and be able to repeat this.I tried to hide the sub divs using , onclick if bla bla = '' ;document.getElementById('hideme').innerHTML = ''; which works, but once I try to enter a new input, then nothing happens, even if the content of the sub divs is = input.

View 2 Replies View Related

JQuery :: Show / Hide Elements Or Remove / Add Elements Based On Radio Selection By User?

Mar 14, 2010

I have a page I am working and I am having some trouble with: I need to show and hide areas based on a radio selection. I initally started using the show / hide feature in Jquery but the problem is the elements need to be removed but then put back if the user selects the radio buttonagain as it has form elements that have validaion on them. The validation is still trying to validate the form elements becuase they are still on the page but just not showing. This is the radio group the user makes the selection from:

<input name="terms_usr" type="radio" id="terms_usr_1" value="1"/>
<label for="terms_usr_1">Credit Card</label>
<input type="radio" name="terms_usr" id="terms_usr_2" value="2"/>
<label for="terms_usr_2">C.O.D</label>

[Code]....

View 3 Replies View Related

JQuery :: Menu Links Show/hide Content In Another Div?

Oct 11, 2011

how to write a script where when a link is clicked in the left nav column, it will display text in the right main column. So, when you first arrive to the page, nothing will appear in the main portion of the site. Content only appears after clicking on a link. When you click on another link, the previous content is hidden, and the new text is displayed. Here's what I have so far:

HTML
<div class="container">
<div class="nav">
<ul id="menu">

[Code]...

View 4 Replies View Related

JQuery :: Dropdown Menu Selection Dynamically Alters Selects Of Other Dropdown Menus On Same Page?

Jul 24, 2010

I have a project where I need a selection of one dropdown menu may affect the select of multiple other dropdown menus on the same page.First, a table is generated, and within each row, it contains a dropdown menu. Assume: Rows A, B, C, etc..., and Dropdown selection: 1, 2, & 3If dropdown in Row A selects 2, then I want the selection of dropdowns in rows B & C to dynamically change to 2.And if in Row C user selects 3, then the selection in dropdowns in rows A & B should dynamically change to 3.

View 1 Replies View Related

JQuery :: Menu FadIn - Show - Hide - FadeOut - Make The Content FadeIn Instead Of Just Showing?

Dec 4, 2011

It is not possible for me to make the content1,2,3,4 fadeIn instead of just showing. When i type 'slow' here content disapear:

[Code]....

View 2 Replies View Related

Div To Appear Based On Dropdown Selection?

Aug 2, 2011

Code:
<div id="1">
<asp:DropDownList ID="DD1" runat="server">
<asp:ListItem>option1</asp:ListItem>
<asp:ListItem>option2</asp:ListItem>

[Code]....

I want the div with the id of "option2show" to be hidden unless the user has selected option 2 in the dropdown box.

If the user has selected option 1 then nothing will happen, however iff option 2 has been selected then the option2 div will appeaar. I would like this to happen before any submit buttons are press, so i guess onblur of the dropdown box.

View 3 Replies View Related

Hiding Dropdown Menus Based On Selection

Sep 8, 2010

i am building a website form which I would like the user to select a product of interest. Some products are three tiered and some are two tiered.

1. Example of three tier (3 dropdowns required only):Scooters (dropdown 1)Three Wheel Scooters (dropdown 2)
Delux 503S Bird Scooter (dropdown 3)

2. Example of two tier (2 dropdowns required only):Standing Bikes (dropdown 1)Children 300 Series (dropdown 2)

If the user wants to submit their interest for one of the products, I need to have at most 3 dropdown menus. So in Example 1, I would have 3 dropdowns in my form. Dropdown 1: Scooters Dropdown 2: Three Wheel Scooters Dropdown 3: Delux 503S Bird Scooter.In Example 2, I would only need to use the first 2 dropdown menus. (Obviously the first dropdown would contain 'Scooters' and 'Standing Bikes' in the menu list)I would like to alter the code so that the second and third dropdowns are hidden until a selection from the first drop down is made. Once for example, 'Standing Bikes' is selected from the first dropdown menu, the second dropdown menu appears and the third remains hidden due to the fact that it is not required. If I selected Scooters from the first dropdown menu, the second dropdown would appear listing all items associated with this and at this point the third dropdown menu is hidden. If i select 'Three Wheel Scooter' from the second dropdown the third dropdown menu now appears listing all Three wheel Scooters such as 'Delux 503S Bird Scooter'.

View 2 Replies View Related

Appear / Disappear Text Box Based On Selection From A Dropdown

Mar 25, 2011

I have a page on which I have 2 dropdowns. Both are similar. I have a piece of code that whill make a textbox appear if we select "list Box" as the option in the drop down. But for some reason, the first dropdown works fine, but for the second dropdown, the textbox is always there on page load. The code that I am presenting can be copied as a HTML page and you will know what I am referring to.

<html>
<script type="text/javascript">
function showfield(name){
if(name=='lstbox')document.getElementById('div1').style.display="block";
else document.getElementById('div1').style.display="none";
}
function hidefield() {
[Code]...

View 2 Replies View Related

Textarea Visibility Based On Dropdown Selection?

Feb 1, 2009

I have a form which has a dropdown menu on it. The last option on the menu "other". When "other is clicked, I would like a textarea to become visible, so that the user can enter the new information. Does anyone know how I might do this?

Here is the html for the form:

HTML Code:
Union: <select name="union" id="union">
<option value="choose">Choose One</option>
<option value="ibew">International Brotherhood of Electrical Workers</option>
<option value="ibt">International Brotherhood of Teamsters</option>

[Code]....

View 6 Replies View Related

Change Form Based On Dropdown Selection

Sep 23, 2011

I have a dropdown box with 2 selections(True/False default False) .If false I want to show under it a form like so.

input text
input check
input text

View 9 Replies View Related

Activate/Deactivate Fields Based On A Dropdown Selection?

Apr 29, 2010

On a registration form I have 4 fields that are all dropdown select fields. NAME, CLASS-1, CLASS-2, CODE

1) I would like to activate the CLASS-1, CLASS-2, CODE fields only if the NAME IS Selected from the dropdown.

2) Also would like to make the CLASS-1, CLASS-2 as required fields if the NAME is selected from the dropdown.

How can I achieve this? Can I use some kind of a server event to activate / deactivate the fields on the form?

View 12 Replies View Related

Disable/Enable Checkboxes Based On Dropdown Selection?

Jan 14, 2011

I have searched and found lots on enabling/disabling form inputs, but nothing that matches my needs.

I have a form with a dropdown with values 0-4. If value 0 is selected I want the checkboxes to be disabled. If value 1-4 is selected I want the checkboxes to be enabled.

Code:
<html>
<head><title>Disable with Dropdown Test</title>
<script>
function num_check(sel,cb) {

[Code]....

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved