JQuery :: Hiding Fields When (Get A Quote) Not Selected In Dropdown Box

Dec 2, 2010

I am creating a simple web form and am having trouble with a quick jQuery script I am using. A few of the fields on my form are not needed if the topic is not "Get a Quote" so I have a script that hides them if "Get a Quote" is not selected in a dropdown box. I does hide them if I select something else but when I go back to "Get a Quote" the fields do not reappear.
$(document).ready(function(){
$("#CAT_Custom_169338").change(function(){
if ($(this).val() == "Get A Quote" ) {
$(".showmore").slideDown("fast"); //Slide Down Effect
} else {
$(".showmore").slideUp("fast");
//Slide Up Effect
}});});

View 2 Replies


ADVERTISEMENT

Js Code On A Form - When Check Box Is Selected The Showing / Hiding Of The Fields Doesn't Work?

Feb 14, 2011

So the following code hides/shows fields in a form when radio buttons are clicked, the problem is on the same form I have a checkbox and when said check box is selected the showing and hiding of the fields doesn't work.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">[code]...........

View 3 Replies View Related

Dynamic Input Fields When Dropdown Value Selected

Apr 10, 2009

I am having a form with a drop down and want to display the fields below it based on the drop down value selected. For example: my form has a drop down <select value> <values: A, B ,C, D) when I select A then I should get displayed a set of fields (like input fields, drop down fields etc) just below the main drop down and when I choose B then it should display a set of fields specific to B and like that. What technology / script to use this to achieve this. I have also attached the sample html page.

View 1 Replies View Related

Preserve User-entered Quote Marks In Form Fields?

Apr 10, 2010

I have a JavaScript application that needs to preserve double quote marks and apostrophes (" and ') that are entered into form fields by the user. The form data is passed through several screens using hidden fields.

Right now, apostrophes work because I have the input fields coded as value="". I have not found a way for JavaScript to retrieve the field's value if double quotes are entered by the user. If I change the parameter to value='' (single quotes) then the apostrophes probably won't work.

Is there a straightforward way for JavaScript to retrieve the field value containing quotes, so that I can manipulate it into a different string that can be easily passed between HTML pages?

View 3 Replies View Related

JQuery :: Use .html() When Have Quote And Double Quote?

Sep 17, 2011

i have a long string contain html tags, javascript code, in a variable, & of corse it contain both ' & " in it.now i want to put all the stuff somewhere in my page, so i assume should use .html() for this. but i think because of this ' & " it does not working. what should i do?

var content_area = $('div#zone1');
content = ' stuff contain quote & double quote';
content_area.html(content);

remember i have both quote & double quote i can't convert all of them to ' or ".

View 1 Replies View Related

Change Selected On Dropdown When A Text Form Is Selected Or Input Is Added?

May 19, 2010

like for example i have text areas named upload1 and upload2when I click or add input on upload1 a drop down list below upload2 will not change, but when I add input on upload2 the dropdown will select "parts"

View 3 Replies View Related

Random Quote Generator, Make Quote In Bold?

Jun 12, 2009

Below is a Random Quote generator script I found on the net, its a great script, but I want the quote to be in bold, how is that done please?

<center>
<font color="#71025F" size="2" face="Verdana,Arial">
<script language="JavaScript">
//
var Quotation=new Array() // do not change this!

[Code]...

View 9 Replies View Related

JQuery :: Hiding Empty Form Option Fields - Working But Inelegant?

May 11, 2009

First post here - I am trying to hide options in a form select field if they are empty. The code below works...but even I know it must be a horrid way of doing it! Anyone care to tidy it up for me? I would learn much from the experience,

[Code]...

View 3 Replies View Related

JQuery :: Hiding Subset Of Form Fields (with Empty Values) Using Focusout Handler?

Feb 4, 2010

I have a contact info form with about 16 fields. I need to hide a subset of fields for address when the end user either (1) tabs out of the subset group, (2) clicks anywhere outside the subset field group.

I do not want to hide the fields when the end-user is tabbing within the subset of address fields, yet the focusout handler is triggered when it shouldn't be.

[Code]...

View 2 Replies View Related

Syntax For Double Quote, Single Quote?

Aug 9, 2010

am writing a function in js that requires me to assign an javascript value to an html element. But I am stuck at a point where I have to assign document.write value to embed object.

function ytEmbedPlayer(videoUrl,w,h){
var flashvars = {};
var params = {allowFullScreen:'true',wmode:'transparent'};
params.allowscriptaccess = "always";

[code]....

I am having issue here were, I have to print videoUrl value as an embed src.

<embed src="document.write(videoUrl)"

I think I am messing up with the single quote and double quote.

View 1 Replies View Related

Hiding Row With Dropdown Selection

Nov 10, 2010

I've got a dropdown and I need for it to open up a row directly below it if the user selects "Yes". I've tried all morning and cant get it to work at all.

View 1 Replies View Related

Hiding Selected Divs

May 30, 2007

Toggling divs is a popular subject and I have found plenty of information and was able to make it work. There is only 1 thing I am still stuck with for quite some time.

I have a dropdown menu and when I select a date from this menu it displays another select box with times for that day. When I select another date another dropdown is shown with times. The problem is now that my page shows two dropdown menus with times.

The dropdown with dates has several dates, so the dropdowns with times that show increases all the time. The question is how do I hide 1 time dropdown div as I select another one? Code:

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

Hiding Dropdown Menu Data From Google

Apr 4, 2010

I have a website with a dropdown menu of brands, these brands are pulled from the database and then display products matching the particular brand.The only problem with this is that google is viewing the dropdown data and it looks VERY spammy, its basically a huge list of keywords.Is there anyway I can stop google from seeing this data so that it doesnt get indexed and is just purely for my visitors to use?

View 2 Replies View Related

JQuery :: How To Set Selected Attribute On Dropdown Box

Aug 2, 2010

Let say I have the following HTML.
<select id="gt_pref_bl">
<option value='enabled'>Enabled</option>
<option value='disabled' selected>Disabled</option>
</select>
Now what I am trying to do is if the person clicks the Enabled option. I want it to changed the option to be selected. I am going to store this value also.

View 3 Replies View Related

Hiding Some Fields In Form When We Click One Option In List Box

Feb 6, 2007

In my list box if i select one item corresponding to that 4 fields has
to be appear below the list box and if i select another item only 1
field has to be appear below the list box and if i select another item
no fields has to be selected.

View 2 Replies View Related

Changing Form Values And Hiding Fields Onclick?

Jun 6, 2009

I'm working on an ordering form which calculates the total order price using Javascript. I have a checkbox which I want to use to toggle the display of various items, and also reset the value of an item depending on whether or not it is checked.

Further details

I have a checkbox for the colour "Black" which, when checked, hides a SELECT, a bit of text, and "Quantity" field. It also resets the value of the "Quantity" field to zero.

When the "Black" checkbox is unchecked, the three items (SELECT, text and Quantity) are revealed again, and the Quantity field for "Black" is reset to zero and hidden.

The reason is that users can only either EITHER a black item or select from a list of colours. Black items are a different price to all others.

How the form works

When the user enters a quantity into a text field for each item, the price of that item is added to the total at the bottom of the form. When the form is submitted (with PHP validation), it emails the order to a salesperson. The price of each item (for emailing the order) is set using hidden form fields with defined values, while the order total is calculated using the id of each quantity field (e.g. "item_31_85.00").

What I need to know

I want to achieve the following when the "Black" checkbox is clicked:

Toggle the display of three items (SELECT field, text (in a DIV) and an INPUT)
Reset the value of the INPUT field (and reset a different INPUT when the checkbox is clicked again)

My current code

The code I'm currently using in the PHP form is below (truncated for readability):

Code:

<input type="checkbox" name="black" onclick="togglecontent('colour_box','colour_price','color_quantity','quantity_reset')" /> Black

[Code].....

Currently I can hide the SELECT and accompanying text when I check the "Black" checkbox, but it won't reset the INPUT value nor hide it. I've not yet attempted to do unhide and hide the Black text and input since I can't get this part working yet.

View 14 Replies View Related

JQuery :: Getting Value Of Dropdown List Selected Value Into A Textbox

Oct 24, 2011

I am using asp.net MVC in my project.I binded the dropdown using a list item as shown below. I was trying to get this selected value of dropdown into the textbox...but this dropdown is binded using list item...

<
div class="field-group">
<div class="editor-label">
<label for="ManagerID">Manager Name</label>
</div>
<div class="editor-field">
[Code]...

View 5 Replies View Related

JQuery :: Change Selected Element In A Dropdown?

Mar 30, 2010

I have a dropdown with following elements [code]...

I want that once i select one element (AAA)from the dropdown and click on a button...it should set the selected element to none...so that i can make my second selection from the dropdown..

View 2 Replies View Related

Hiding / Disabling Submit Button Based On Dropdown Selection

Nov 9, 2010

How can I hide/disable the submit button if the name Todd is selected?

View 7 Replies View Related

JQuery :: Set Dropdown List Selected Value After Dynamically Populating

Dec 29, 2010

I have 2 drop down list that are populated through mysql. They both contain data upon initial page load. However when you select an option from drop down #1 it populates drop down 2 with data associated to it. Sometimes the 2nd drop down list has selected data already and I need it to be cleared back to the first option when the first drop down is selected.

the following code is what I use to populate the second drop down

$.ajax
({
type: "POST",
data: "company=" + $(this).val(),

[Code].....

View 1 Replies View Related

JQuery :: Show A Text Box When An Option Is Selected From A Dropdown?

Oct 7, 2010

I have the following dropdown list box [code]...

I want to show() a textbox and a label based on someone selecting the "is between" option of the dropdown list.

I have multiples of these dropdowns and all of them will have to do the same thing. In other words I have

DDLConditional1 2 3 4... infinite. I've already been able to make the button work that appends new conditionals.

View 1 Replies View Related

JQuery :: Show Dropdown Selected Value As Normal Text?

Apr 21, 2010

I use jQuery in a sharepoint environment and I have a form with a lookup value(dropdown), I set the selected value of the dropdown from code based on a query string parameter.

When I disable the dropdown the value will be ignored when posting the form, currently I hide the dropdown which will save the value on post but will ot show on page.

The question is,

Can I use jQuery to get the selected value and display this a normal text?

View 3 Replies View Related

Jquery :: Hide Input Field If Dropdown Item Selected

May 24, 2010

I have a page as below, I hope the form only show Select option when loading, then the input date fields will be displayed if select event category, where are the errors?

Code:
<script src="/misc/jquery/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$.viewInput = { '0' : $([]),
//THIS IS THE NAME OF THE DIV WRAPPING THE HIDDEN FIELD
'1' : $('#1'),
};
$('#category_class').change(function() {
// HIDES THE INPUT FIELD IF ANOTHER DROPDOWN ITEM IS SELECTED ONCE THE HIDDEN FIELD IS LOADED
$.each($.viewInput, function() { this.hide(); });
// SHOWS THE INPUT FIELD ITEM IF SELECTED
//$.viewInput[$(this).val()].show();
}); });
</script>

<table cellpadding=4 cellspacing=1 width="650" border=0 class='list'>
<tr> <td class='caption'>
<form action="save.asp" name="pvt_spec" method="post">
<table border=0 cellpadding=4 cellspacing=0>
<div id="1"> <tr>
<td nowrap><font size=2 color="#ff0000"></font>Start Date</td> <td class='data'>
<input onClick="this.select()" tabindex="1" type="text" name="s_dt" value="2000/01/01" size="13" maxlength="13" STYLE='text-align=center;'>
</td> </tr> <tr>
<td nowrap><font size=2 color="#ff0000"></font>End Date</td> <td class='data'>
<input onClick="this.select()" tabindex="1" type="text" name="f_dt" value="2078/12/31" size="13" maxlength="13" STYLE='text-align=center;'>
</td> </tr> </div> <tr> <td>category</td> <td class='data'>
<select name="category_class" id="category_class" tabindex=1><option value="1">Base category</option><option value="2">Parent Event Category</option><option value="3">Son Event Category</option></select>
</td> </tr> </td> </tr> </table>

View 9 Replies View Related

JQuery ;; Ui - First Item / Option Of The First Dropdown Is Being Displayed As Selected Value Of Other Dropdowns

Oct 1, 2010

refer to following link and you will see first item/option of the first dropdown is being displayed as selected value of other dropdowns. [URL]

View 1 Replies View Related

Display Div When Dropdown Selected?

May 22, 2010

I have two divs in my message...one named website design and one named twitter design both set to display none

when website design is selected i want the websitemessage div to display

when twitter is selected i want the twitter message to display...[code]...

View 8 Replies View Related







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