JQuery :: Show Or Hide A Single Section Of A Form Based On The Value Of A Select Box?

Aug 2, 2011

Using jQuery, the hide show part is easy. I need to show or hide a single section of a form based on the value of a select box. More specifically, if the select box is one of 30 countries, then show, else hide.

What's the easiest way to handle this?

View 4 Replies


ADVERTISEMENT

Show - Hide Div Based On Select Box Choice

Jun 22, 2011

I have a select box where the value must be passed via the form. If the users selects choice B or Choice C then I want a specific div to show. If they choose choice A then I want the div to hide or remain hidden. It should be hidden on page load.

Code:

View 1 Replies View Related

Show/Hide Div Based On Select Box Choice?

Jun 22, 2011

Ok so I have a select box where the value must be passed via the form. If the users selects choice B or Choice C then I want a specific div to show. If they choose choice A then I want the div to hide or remain hidden. It should be hidden on page load.

<select name="Event_Type_ID">
<option value="1">Choice A</option>
<option value="2">Choice B</option>

[code]....

View 2 Replies View Related

Show/hide Div Based On Radio Button Select

Jul 12, 2007

i would like to have 2 radio buttons each with a associated div when the page loads the first radio button will be checked and its corresponding div will be show when the user checks the other radio button its corresponding div is shown and the first div is hidden:

View 2 Replies View Related

JQuery :: Hide/show Divs Based On Form Parameters

Jun 13, 2009

I'm trying to selectively hide and show divs based on what a user specifies using three select boxes in a form. I'm probably missing something obvious, but here's what I've got and it doesn't, work, they divs just stay hidden.

<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">

[Code].....

View 2 Replies View Related

Show/hide Multiple <tr> Based On <select OnChange="?

Jul 24, 2011

Show/hide table rows via select menu choices - And I changed my Javascript up a little so that I would have an easier time remembering it.Here are the codes:

HTML

<table cellspacing="5" cellpadding="5" border="0">
<tr>
<td><strong>Request Service:</strong></td>
<td><input type="radio" value="Website Design" />

[code]....

View 4 Replies View Related

JQuery :: Show Form Fieldsets Based On Select?

Jan 19, 2011

Basically I have 3 fieldsets

Field set 1 has 4 selects, for selects 1-3 I wish to show fieldset 2 and hide fieldset 3, and for select 4 i wish to hide fieldset 2 and only show fieldset 3

They all currently have fieldset ids:

fieldset 1 id = choice
fieldset 2 id = server
fieldset 3 id = forum

fieldset 1 currently looks like this:

<fieldset id="choice">
<legend>Service</legend>
<ol>
<li>

[Code].....

View 2 Replies View Related

JQuery :: Show/hide Form Elements Based On Radio Button Selections ?

Mar 17, 2011

I have a set of radio buttons on my pricing page:

And a corresponding text_field input element div I'd like to display based on which radio button the user selects:

When the page loads, I'd like to see:

When the user clicks on a (different) radio button, or clicks one for the first time, I'd like whichever div is currently showing to be hidden, and the newly selected one to be shown.

Right now I have jQuery code at the bottom of my page that looks like this:

For each of the four options.

When the page loads, the correct div is shown, and when I select a new button, the new div is shown, but the already showing one isn't hidden.

I've read some posts that suggest using change() instead of click(), but others indicate that's problematic in IE.

View 1 Replies View Related

Jquery :: Show And Hide Script When Clicked On Link Of Particular Section?

Dec 16, 2011

I have working code to Show/Hide content when clicked on link of particular section:

var showText="Show content FAQ1";
var hideText="Hide content FAQ1";

1. How to do link on particular Title and show this description like Description1, Description2 etc.

2. How to open some sections in advance inside Javascript?

Working code is the following using Jquery jqueryV1.4.4:

PHP Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">[code]....

View 1 Replies View Related

Show - Hide Form Fields Based On Checkbox State

Mar 4, 2010

I'm trying to get the two followup questions underneath the checkbox to show up only if someone places a check there, but for some reason the way I've got it set up now it's simply hiding the area I want to show up altogether, and the checkbox has no effect on it.

Rather than waste tons of space pasting it here, here's the pastebin: [url]

Alternatively here is the live version:[url]

I'd prefer to have the form collapse when the additional questions are hidden, though if i can get this working at all.

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

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

JQuery :: Show/hide With A Single Click

Sep 14, 2010

The following code is a typical show/hide combo, followed by an attempt to do the same with a single control ("singleClick").

Unfortunately, it opens the "extra" dive but won't close it.

Is it a fault in my javascript, or am I asking the jQuery to use logic incorrectly?

This is the code:

View 1 Replies View Related

JQuery :: Show / Hide Single Div With Multiple Links

Mar 22, 2011

I am getting to know jquery a little, and I am trying hide and show a div when a link is clicked.I have a page setup that has a flash video in a div on the main page. Then when a link is clicked, a lightbox window opens and plays another video. I am trying to get the video on the main page to hide while the lightbox video is playing. Then when a user closes the lightbox window, the div with the main video on the page is shown and starts playing again.So far I can get this to work with one link. But I cannot get the main video div to hide when a second link is clicked.

View 1 Replies View Related

JQuery :: Show / Hide DIV Based On Selected Value Of Tag

May 29, 2010

I have a simple jQuery code that shows or hides a DIV based on the selected value of a select tag. Currently it looks like this and it's working fine:
if (selected == "0") jQuery("#divPublishDate").show('slow')
I want to add an else so that the if the value is anything other than 0, I want to hide the div. What's the proper syntax in this case? I assume this is the short version of an IF statement without the { }.

View 2 Replies View Related

JQuery :: Hide / Show Based On Scroll?

Mar 29, 2010

I've got a fixed div that has a fixed tab as a trigger. I'd like to only show the trigger tab when the user scrolls down the page "X" pixels from the top (say like 200px). Can someone point me in the direction of implementing this?

View 4 Replies View Related

JQuery :: Show/hide Div Based On URL Parameter?

Feb 13, 2010

I have a div that should be hidden on default, but when a certain URL parameter is present, then the div is visible.

[Code]...

View 3 Replies View Related

Jquery :: Hide / Show Div Based On Radio Class?

Apr 18, 2010

what i have are 3 radio buttons at top of my form, the first radio option i would like if selected to open a div that contains new questions on the form... then if the other radio buttons are selected they hide that div.

View 1 Replies View Related

JQuery :: Hide/Show Based On Radio Button Selected?

Sep 14, 2009

I am trying to create a script that will display content based on if aradio button is selected, and if the other is selected would hide thecontent. Now, each of these radio buttons are part of a radio group,so their names are the same. Most examples show nput:radio[@name=item] Since I have 2 items that have the same name, I can't usename, so I thought I would try id or value. It isn't working. If I addonly the show, whenever you select either radio button, it shows, andif I add the hide code, it doesn't work at allHere is what I have right now.

$(document).ready(function(){
$('#offices_checkboxes').hide();
$("input:radio[@value=1]").click(function() {

[code]....

View 2 Replies View Related

JQuery :: Show / Hide Images Based On Checkbox State?

Apr 13, 2010

What you can see is that I have a bunch of images which form a chart, each of the images has multiple classes.I want to write a function which when called fades in/out images dependant on whether all related checkboxes are checked or not.Checkboxes are related to the images by id on the checkbox and class on the image, as I'm sure you can see. I will be calling this method each time a checkbox is checked.

View 2 Replies View Related

JQuery :: Show / Hide Table Rows Based On Groupnames

Oct 21, 2011

Say, for example, I have a table with an undefined number of rows. Row 1 contains number 1 to 10, row 2 contains 11 to 20... you get the picture. The table is autogenerated and id's are made unique by the system (GUID's plus id). I am able to add a 'name'attribute to'img''sthat are in the td's and add a groupname i.e. '11to20'. Using this i want to test showing/hiding grouprows. Now I have a dropdownlist on the page where the user selects the groupname from
i.e."11to20". I would like to be able to hide the rows not having the selected groupname
and show the rows that do. I've constructed a query that would hide the selected groupname but it hides all tr's.
$(obj).attr('name', obj.options[obj.selectedIndex].value).parents('tr').siblings().fadeOut('fast');

Here's the (simplified) sample html I constructed by hand for this message:
<fieldset class="my-form"><div>
<div class="NumberSelector"">
<label for="ChooseNumber">Choose a number</label>
<table id="ChooseNumber" cellspacing="10" border="0" style="width:542px;">
<tr><td><label for="ChooseNumber_1">
<img name="1To10" src="/images/number1.jpg" alt="number1" onclick="ImagePopup(this);"/> .....

View 3 Replies View Related

JQuery :: Show Input Box Based On Select Value?

Apr 14, 2011

It shows an input field when the select value is "dropped". The problem I am having is that if I select "dropped" it will display the input field, but if i select a different value AFTER selecting "dropped" the input field is sill displaying. How would I get it to hide the input field if it is NOT selected?

<!--SHOW/HIDE DIV-->
<script type="text/javascript">
$(document).ready(function(){
$('#dropped').hide();

[Code].....

View 2 Replies View Related

JQuery :: Select Show/hide Div

Nov 5, 2008

I have a select box that has four options. It has a single div below it with some news text in. When I select say item 2 in the dropdown I would like the div to change to another one, basically swap out the div based on the select option. I have been trying to do this using jQuery but no luck.

View 8 Replies View Related

Show - Hide Div Based On Cookie Value

Nov 12, 2009

I am trying to finish a script that shows a particular div based on the last 2 chars in the cookie value. I have the cookie part done. how to show hide part.

View 7 Replies View Related

Show - Hide Div Based On Checkbox ?

Aug 21, 2011

I know from scouring the Web that this is a very common Javascript question, but I have a twist on the question which is giving me headaches, and I hope some of the brilliant minds here at DaniWeb can help show me the error of my ways.

Say a user has checked a checkbox when submitting a form. I have a PHP script that records that check in a MySQL record. Later when they visit the page, the PHP script shows the checkbox as being checked. That's all working fine.

Now here's what I'm TRYING to do: Since the checkbox is checked when the page loads, I want a certain div to show up. And when the user UNchecks the checkbox, I want the div to go away. Simple, right?

Here's the Javascript I've placed in the header:

In the CSS, I've styled a div thusly:

And here's what I'm doing in the <body>:

This should show up when you click Yellow Box. And it should go away when you click it again. </div>

When I uncheck the checkbox (first click), nothing happens: the div still shows up.

Then when I re-check the checkbox (second click), the div goes away.

And then when I un-check the checkbox again (third click), the div comes back.

In other words, it's doing the OPPOSITE of what I want.

It seems that when I click the checkbox the first time (to uncheck it), the Javascript pulls an empty value. Only with the second click is it finding a value ('none').

View 3 Replies View Related







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