Show / Hide Divs Based On Radio Input

Mar 25, 2010

I'm having some issues with showing / hiding divs in a form based on radio button input. I'm fairly new to JavaScript so I'm still not 100% on what I'm doing... I have a pretty extensive form with quite a few container divs that are set initially to "display: none" and I need them to be set to "display:block" dependent on radio button input.

For this piece, I need the div with id "SFSCPROJSPONCOMP" to be displayed when the user selects the Radio button with name "PROJSPON" and value "COMP".If someone could provide me with JS code for that example, I can get through the rest of this form with ease.

View 2 Replies


ADVERTISEMENT

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

Get My Form To Show And Hide Various Divs With Radio Buttons?

Oct 26, 2010

I'm trying to get my form to show and hide various divs with radio buttons. There are multiple options in the second box of my example. When a user selects the first option, more input boxes come up. Perfect, that's what I want. However, if they decide they didn't mean to click that option and instead wanted another option, the original part that popped up doesn't disappear. I cannot figure out how to make this happen.

View 6 Replies View Related

Show / Hide Divs Based On POST Value Sent From Another Page

Apr 26, 2011

The two page sections you see on the page "One Time Gift" or "Monthly Subscription" are normally hidden via a document.write via a body onload. Generally, all of this functions well. But, I want to expand the use a bit here so I want to pass a $_POST value to this page from another page which hides or shows these two sections based on this passed value. So, if the value in "once", I want the div with the id="onetime" to be visible and the other div to be hidden. If the value is "monthly", then the opposite would happen. Now this is supposed to all happen as the page loads because we are just arrivng here from the sending page.

View 9 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 Divs Based On One Div And Search Text?

Jun 14, 2011

I am going to achieve something like this.

<div id="sidebar">
<div id="html1"><h2>Test 1</h2></div>
<div id="html2"><h2>a1 tes2</h2></div>
<div id="html3"><h2>a2 tes3</h2></div>
</div>

The thing is that first I need to detect if the div id is "sidebar" if its "sidebar" then it will pickup all the text inside h2 tag and will search for a1 or a2 in the text.If a1 is found then it will pickup the id html2 and make this div only visible.So in this case it will pickup id html2 and make it visible while other ids like html1 and html3 will be hidden.

View 2 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 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 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

Display/Hide DIV Based On Radio Button Input?

Dec 1, 2009

I'm fairly new to Javascript and would be grateful for any help you can give me. I've had a search on Google and found a couple of potential solutions but nothing seems to work quite right for what I need.

Basically I have a form with several questions followed by Yes/No radio buttons. Dependent on which answer is given, I want to display a different message above the text box.

For example, if you answered 'no' to a certain question then the message above the text box would change to say "Please fill in additional information" or something along those lines.

[Code]...

View 3 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 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 / 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 :: Show Two Separate Divs, Hide Divs On One Click?

Aug 19, 2009

I'm looking for some javascript to work with wordpress (jQuery preferrably) that will show/hide multiple divs on one click.

I had one working but it was kinda janky because it was causing me to have two divs with the same ID on one page. No good.

Since I updated to wp2.8.3 prior to launch, it's not working. So I've decided to just try and do it right.

Here's a page: [URL]

So, what I want to happen: On page load, the first tab: "general" and it's corresponding div beneath should be showing. And the first image should be showing. The other content divs and images should be hidden. I've given the text content divs a dashed border to show their borders. When a visitor clicks "dine at home" the general div and image hide, the second content div shows, as does the second image (it's currently the identical image, but the client may change later.) Etc.

I'll be using this function on a few other pages as well.

how to adjust this javascript to work on two different IDs at once?

current code:

Code:
<script type="text/javascript" charset="utf-8">
$(function () {
var tabContainers = $('div.imgswap > div');

[Code]....

View 2 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

Show One Div & Hide Two Other Divs

Apr 12, 2010

I have 3 divs containing images floated next to each other and when clicked i want a new div to appear beneath these 3 images. Clicking on the first image i want a new div to appear beneath these 3 images. Clicking on the second image must hide all other divs and only show the content for that div.

View 7 Replies View Related

Using A Script To Show Or Hide Divs?

Jun 28, 2011

im using a script to show or hide divs

<div id="div1" style="display:none">div1</div>
<div id="div2" style="display:none">div2</div>
<a onclick="showIt('div1');">div1</a>
<a onclick="showIt('div2');">div2</a>

[Code]....

the script works fine with one problem. I would like div1 to be initially visible but if i remove the style="display:none" then the script does not function correctly.

View 1 Replies View Related

Inconsistencies Trying To Show/hide Divs With JS?

Feb 25, 2009

I'm using a pretty simple submenu to try to hide the div sections I don't want, isolating the ones I do want to be the only ones visible. My code isn't the most concise when addressing this problem, but it looks like it should still work.

Make sure you use Firefox (because I'm still very early in development and I dislike IE) and use this link [URL]... to see for yourself: Observe that there are two videos and one graphic. Hover over "my work" and click graphic. Fine, right? Now click video.

The div sections are identical in naming conventions. Is it that the JS can't act fast enough? I thought I remedied that by calling isolateDiv() after I had hid all the unwanteds.

[Code]...

This is just a small portion of my code. The sections separate fine when you first click the video link.The problem is that after you select one section, and then decide to select another one, only the first post with that div id shows up. Try the link at the top and hover on the "my work" section to try.

View 2 Replies View Related

Having 1 Dive That Hide/show All Divs?

Jun 27, 2011

is it possible to have 1 dive that hide/show all divs the div i want to open all or hide all is

<div id="expandall" onclick="toggleall('noticecontent[i]');" div style="cursor: pointer;" div align="center"> Abrir tudo</div>
<html>
<head>
<script type="text/javascript">

[code].....

View 3 Replies View Related

Show/hide Divs Using Select?

Sep 13, 2011

another day, another problem ;) I have a select:

<label for="tiers">Number of tiers</label>
<select name="tiers" id="tiers" onchange="showtiers()">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>

[Code]...

View 5 Replies View Related

Hide/show Divs Simultaneously?

Feb 10, 2011

I have 2 things that I want to show/hide using JS.

Code:
<html>
<head>
<title>Hidden Div</title>
<script language="JavaScript">

[Code]...

If I don't use style="display:none" inside the divs, I see them both initially and I can hide/show each one depending on which link I press. But the thing is that I need both divs to be hidden in the first place, and when I click on ONE, to show TWO, when I click on TWO to hide ONE and show TWO etc. Each time 1 div should be visible, depending on which link we press. The other must disappear.

View 2 Replies View Related

Unobtrusive Way To Show/hide Divs

Jan 10, 2007

I've got the following code in a website of mine:

Code:

<a href="section1.htm">Section 1</a>
<a href="section2.htm">Section 2</a>
<a href="section3.htm">Section 3</a>
<a href="section4.htm">Section 4</a>

<div id="general">General overview</div>

<div id="section1">Section 1 overview</div>
<div id="section2">Section 2 overview</div>
<div id="section3">Section 3 overview</div>
<div id="section4">Section 4 overview</div>

I want to display the div marked 'General overview' by default, and to hide all of the other divs (section1, section2, section3 and section4) but would like to swap out the 'general' div with the other divs as the corresponding links are moused over.

e.g. mousing over the Section 2 link will replace the 'general' div with the 'section2' div. On mousing out, it will revert back to the 'general' div. Mousing over the Section 4 link will replace the 'general' div with the 'section4' div. On mousing out, it will revert back to the 'general' div. Etc etc....

View 11 Replies View Related

Show/Hide Divs By Class Name?

Aug 23, 2011

I have the situation where in the first instance I would like all divs to be visible.

Only when the user selects something in a select menu the non selected divs will hide.

I have the following:

Code:
<select name="type">
<option value="ShowAll">1</option>
<option value="Selection1">1</option>
<option value="Selection2">2</option>

[Code].....

So, if the user were to select "Selection1" two divs should only be visible. The same will apply for others, if "selection4" is made then only one div would be visible.

The user will need to the option to reset and display all divs by using the "ShowAll" selector.

I ahve seen examples of this on the net however, they do not show all the divs in the first instance and they are donhe by ID and not class. I need to do it by class as I have some with the same name and they cannot change.

View 5 Replies View Related

Jquery :: Show And Hide Divs?

May 24, 2010

I have been using a jquery based plug-in, and what i would like to do is degrade it, so a non js enabled browser will hide the relevant div when js is not enabled, and show a different div with appropriate message content.i have followed a couple of tut's which do this on click, but i would like this to occur on page load.

View 2 Replies View Related

Hide / Show - Any Way To Change Through DIVs?

Oct 5, 2009

So I have a few divs that I'm hiding and showing whenever a you click on a link. So I'm a newbie at JavaScript and this is the best way I know how to do this.
var divElement = '';
function show(divElement) {
if(divElement == 'add') {
document.getElementById('uploadImages').style.display='none';
document.getElementById('addTutorial').style.display='block';
document.getElementById('editTutorial').style.display='none';
document.getElementById('tutorialsImages').style.display='none';
document.getElementById('pendingTutorial').style.display='none';
document.getElementById('deletedTutorial').style.display='none';
} else if(divElement == 'edit') { .....

View 8 Replies View Related







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