2 Select Boxes In 1 Form With Onchange Display
Jun 17, 2010
I'm using onchange display to hide/show form elements depending on the value of a select box. It works perfectly well (I actually really adore it) for one select box, but I have another select box which I'd like to act similarly.
<head>
But when I go to add a second select (obj,id1,id2,id3,id4,id5,id6) with new "ifs" and id's, etc and so forth, neither work.
Is there any way to fuse them and get a second select to work the same?
View 1 Replies
ADVERTISEMENT
Jul 25, 2002
I searched here and some other places on the net but cant find anything that suits my needs. I have a SELECT box with 3 values Code:
<form name="form1">
<select name="length">
<option name="length" value="none">--Select for All--</option>
<option name="length" value="5">--5 Days--</option>
<option name="length" value="7">--7 Days--</option>
<option name="length" value="10">--10 Days--</option>
</select>
</form>
OnChange, I want to invoke a function that auto populates the rest of the SELECT fields in the form. The select boxes will vary in quantity as the page is dynamic, but the values are always the same (like the code above).
Does this make sense?
View 9 Replies
View Related
Sep 6, 2010
I have two basic select lists and I want to automatically submit the values from the first list once they select from the second list using onchange. how to get the multiple values from the first select.
So basically I want them to select a state or states from the first list and in the second list they can choose from some data parameters to query within those zip codes. So once they select data parameter(s)... the onchange should kick in and pass both the zip code selections and data parameters to the getData function.
Trying something like:
PHP Code:
<select name="state" multiple size="5" >
<? while($row=mysql_fetch_array($result)) { ?>
<option value="<?=urlencode($row[0])?>"><?=$row[0]?></option>
<? } ?>
[Code].....
By using state.value I get ONE of the select items and not multiple. And I've tried state[] and variations of state[].value or state.value[]... no luck.
The onchange=getData is a function that puts together a URL to get data from another page. So I really need to pass something like state[]=1&state[]=2
Therefore it seems like the state select needs it's own onchange to run a local function that formats this URL string??? then how do I get that value?
I have it working as two completely seperate form elements but I really want to make these two selects one form/step that they have to complete.
View 3 Replies
View Related
Feb 23, 2009
I'm attempting to change the display property of certain divs depending on the criteria of multiple select boxes.
I got it to work by GetElementsByTagName('div') but it then selects all divs rather then the select few i actually want it to work on. I tried changing the selection to GetElementsByName but this doesn't work, why i don't really know.
I've dumped the source code below:
Code:
View 4 Replies
View Related
Jul 24, 2009
<script language="JavaScript" type="text/javascript">
<!--
/*[code]....
// This script supports an unlimited number of linked combo boxed
// Their id must be "combo_0", "combo_1", "combo_2" etc.
// Here you have to put the data that will fill the combo boxes
// ie. data_2_1 will be the first option in the second combo box
// when the first combo box has the second option selected
// first combo box
data_1 = new Option("Business Cards", "$");
data_2 = new Option("Club Flyers", "$$");[code].....
I have this code, and I was wondering if it is possible to make the select boxes appear AFTER you select the field before.
View 8 Replies
View Related
Jul 6, 2006
Alright. I want to make an onchange image thing; where someone can select a name from a form and it will display an image.
I want the form to have two options.
They can pick a MALE or FEMALE version (these two things in one box)
and below it, they can pick different PET versions of it.
So:
1st box: male, female
2nd box: pet one, pet two, pet three, etc
View 3 Replies
View Related
Feb 4, 2009
How can I get and pass the value of an HTML form select object to a javascript function? code...
View 3 Replies
View Related
Jun 5, 2009
I have four html form check boxes.The user is allow to choose one or three of the check boxes, the last check box has a value of None.
Example: What's your favorite color.1. Red 2.Blue 3. Green 4. Gray. 5. None.The user can select more then one color.So I'm wondering how can I make the other check boxes deselect when the user click None.So if the user select None, then the other boxes cannot be checked. know you can do this with radio buttons but I would like the user to select more then one option.
View 4 Replies
View Related
Mar 9, 2009
I am building a form with ColdFusion, HTML, and will be using some Javascript, and I wnt the javascript to tell one form object to display itself when a certain option is chosen from a <select> tag.
<cfquery name="getCategories" datasource="#mydatasource#" username="#myusername#" password="#mypassword#">
SELECT * FROM categories WHERE type = 'cat' ORDER BY id
</cfquery>
<cfform action="engine.cfm" method="post" format="html">
<table cellpadding="0" cellspacing="0">
<tr><th colspan="2">New Category</th>
</tr><tr>
<td>Category Type:</td>
<td><select name="type">
<option value=" "></option>
<option value="cat">Main Category</option>
<option value="sub">Sub Category</option>
</select></td></tr>
<tr><td>Name:</td>
<td><cfinput type="text" name="title" size="20" maxlength="100" required="yes" message="A name for the category is required.">
</td></tr>
<tr><td>Parent Category:</td><td>
<cfselect enabled="Yes" name="parentcat" multiple="no" query="getCategories" value="id" display="title" queryPosition="below">
<option value=" "></option></cfselect>
</td></tr><tr>
<td colspan="2"><cfinput type="submit" name="submit" value="Submit" validate="submitonce" validateat="onserver,onsubmit"></td>
</tr></table></cfform>
I want the <cfselect> tag to display on if Sub Category is selected on the first <select> tag. I expect that it will use the onchange attribute but other than that I have no idea.
View 2 Replies
View Related
Sep 20, 2011
I am trying to display a rel of each option as they are selected into a div below it . There are several selects of classProductAvailability on the page. When one of the selects changes, I'd like the value of the rel of the selected option to display.At first it seems to work, but only if you start by changing the last pull down menu. The trouble seems to be in the"select.ProductAvailability option:selected", this needs to be written for this instance, not all of the selects of that class on the page. How do I write that, I've tried$(this+" option:selected") but it won't take.
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("select.ProductAvailability").change(function () {
[Code]...
View 2 Replies
View Related
Apr 10, 2010
I've set up my form with javascript popup boxes to display help. Im using mouse over to display the boxes, and I'm specifying the top, left, and size values for each box..... Which works FINE on my monitor...... BUT, a user was running the application and they were on a differently sized monitor and the boxes were in a different location...
My monitor was set at 1024 x 768. The user was set at 1280 x 800. I presume the reason the boxes appear to be moving is because screen varies while the form is constant... So, does javascript use it's zero, zero point for top and left locations of the box from the monitor rather than the window the form is running is? And if so, how do I set these up so they DON'T move around and obscure things they shouldn't?
View 2 Replies
View Related
Jan 26, 2010
I am looking to make a page with a display on it using input boxes, but I want the input boxes to get some of the values from an array I enter at the beginning. To start with I am only entering 2 items, as it will make it easier until I have it all up and running. I have no problems getting a table to come up, with a label and then an input box beside it. I can even prompt the user for the number of input boxes they require. I also can make it so that the input box is disabled, so that the user cannot change the contents of it. But, I am totally stuck as to how to get this how I want it...
I am wanting labels at the top of each row, not the left hand side, and I am wanting rows of 3 input boxes, with the first 2 containing the text from my array, which is what I'm wanting ti be the disabled boxes. Basically I am starting a very simple page for an online order facility.
This is the code I have been working on, I have totally messed it up by now trying different things but it will give an idea of what I have been attempting I figured lol. I have got it to have 6 empty input boxes all on top of each other, but I realised after that if i set all the values etc in the table, then im not getting the array to define the contents :S and, they are still all on top of each other which i dont want... And my attempts at getting the array to define the number of input boxes has so far been futile. I end up with a blank page, just a button. just getting frustrated lol.
[Code]...
View 4 Replies
View Related
Nov 15, 2011
I've got the following, very basic, working DHTML code...
But I want the final answer to come up as text on the screen rather than as an alert pop-up. Any idea on how I'd do this? I'm very new to web development (been working on it for a day)
View 2 Replies
View Related
Jan 19, 2006
How can I change a select list when a user enters a value into a text box? Like with the below form I would like to have the select box change when the user enters a value in the "id" text box that matches a value in the select box. Say the user types "1122" in the text box I would like the select list to change to to show "John". Is this possible ....
View 5 Replies
View Related
Jul 20, 2005
We have had this script on our site for a while, and it has always
worked in any browser we have tested. It dynamically fills one select
based on the selection of another select. Unfortunatly, with the
release of NS 7, and the related Mozilla engine, this script no longer
works. Code:
View 2 Replies
View Related
Jul 20, 2005
I have 3 select boxes! one is hotel one is destination and one is
country...
if someone clicks selects the country then the destination select box shows
the destinations in that country and further if he chooses destination all
the hotels in in that destination are shown in hotel select
box....(everything is from mysql database)
I don't have a clue how to do this or where to find some readings about it
and I really need that desperatly....
View 4 Replies
View Related
Mar 5, 2009
I have a form that starts like this: http:[url].....I would like to have it set so that when they select Atlantis, it pulls out information into the second box, then they select something in there and it creates a list in the last box... does anyone know how to do this?
View 2 Replies
View Related
Jul 25, 2009
I am using alot of Select boxes on one of my PHP/XHTML pages and i need to ensure the user has selected at least one option from the box.I have little experience with Javascript, but I tried this;
function madeSelection(elem, helperMsg)
{
if(elem.nodeValue == null)[code].....
All that is happening is its returning a boolean false regardless of whether or not i select an option.
View 2 Replies
View Related
Dec 1, 2011
I have a form with check boxes. If I click any check box another set of text boxes are opened .I have done this using show/hide java script code. I created the edit page where all the info is loaded from database. It has check box checked on load from the database values.How can I open respective text boxes if check box checked on load .
View 1 Replies
View Related
Sep 27, 2007
I have a bunch of select statements in a form, and each select statement
has an onchange="do_something(this)" in it, and this works
nicely..except when there is only ONE OPTION in a given select.
It seems you cannot 'onchange' a single option!
Well, that is reasonable.
The trouble is I have no way of selecting it since the form itself is a
dummy: The form action is basically to submit to a new script with
hidden variables carefully set to get the desired action depending on
the last option selected Code:
View 14 Replies
View Related
Nov 12, 2009
I am trying to add an onchange event to a select tag.
This is my code, but it does not appear to be working.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
[Code]....
View 4 Replies
View Related
Sep 6, 2011
Just to give an idea on my objective.I have an user level that a user can choose between "User","Support" and "Admin" Level. If the user choose "Admin" my <div id='userlevel'> will become hidden and vise versa of the level.I have tested it on Html and js code it work just fine, but my error begun upon inserting it on php.My error on my page said " 'selectmenu' is null or not an object".This is my html and js code
<html>
<head>
<form >
[code]....
View 3 Replies
View Related
Jul 9, 2007
i am trying to get to work and i don't get why its not working so i am going to post it here and if someone who is smarter then me could come on and let me know why its not working and how i can fix it. if you have any questions let me know and i would be glad to answer them. Code:
View 10 Replies
View Related
Jun 23, 2009
I want to make one application using javacript or may be it is in ajax. Let me explain my problem: I have one select box name person which have value 0,1,2,3,4,5 . Now i want that when user will select value 1 from select box then person 1 first name , last name input type box will appear only one time in a row. and if we will select 2 from select box then two row will appear naming person1 and person2 like this: if we will not select any value by default is 0.then it will not show any row regarding person.
[Code]...
View 1 Replies
View Related
Sep 6, 2011
My Error. Just to give an idea on my objective. I have an user level that a user can choose between "User","Support" and "Admin" Level. If the user choose "Admin" my <div id='userlevel'> will become hidden and vise versa of the level.
I have tested it on Html and js code it work just fine, but my error begun upon inserting it on php.
My error on my page said " 'selectmenu' is null or not an object".
This is my html and js code
Code HTML4Strict:
View 4 Replies
View Related
Aug 26, 2011
I am using the OnChange event with the drop down box populated with countries.....but only works when certain countries are chosen.
When a country is chosen the OnChange event fires, passing a variable to the same page using the location.href.
Once this is done the onload within the body tag calls the function SetFocus() to the First Name text box.....which does not always work either.
Here is the code:
Code:
HTML Code:
HTML Code:
View 5 Replies
View Related