Two Select Boxes - Getting Both Values With One Onchange/submit

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


ADVERTISEMENT

SELECT OnChange Auto Fill Other SELECT Boxes

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

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

JQuery :: Add Values Of Select Boxes?

Oct 16, 2010

I am trying to add values of selected options in select boxes that update on any change...

I don't know why this is not working [code]...

View 2 Replies View Related

Identify SELECT In OnChange Submit?

Nov 21, 2009

I have a form with multiple SELECT drop-down menus. Each menu can submit the form using the onChange function. How can I determine which of the drop-down menus was used to submit the form? Example:

<form method="post" enctype="multipart/form data" action="submit.php">
<select name="one" onChange="submit()">
<option value="1">1st choice</option>

[code]....

View 3 Replies View Related

Extracting Values From Select Boxes And Summing The Result?

Sep 4, 2011

I'm working on a project that involves extracting values from a series of select boxes and then working out the result.

The select boxes contain the following:

<select name="select_Col1_Row1">
<option value="blue">Blue</option>
<option value="green">Green</option>
<option value="red>Red</option>
</select>

[Code]...

View 5 Replies View Related

Multiple Select Boxes :: Make The Select Boxes Appear AFTER You Select The Field Before?

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

Check Boxes - De-select Other Boxes By Click Another Box?

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

Seperate Concatenated Form Values - 4 Text Boxes That Are Supposed To Load 4 Seperate Values Of Data

Jan 27, 2010

I have 4 text boxes that are supposed to load 4 seperate values of data from one field in one table from a database. The field is called interface_cropsettings (from the interface table) and these values have been concatenated and comma seperated in this field.

Code:

Once the form is filled out and saved, the data is inserted into the database and the values from these 4 text boxes are concatenated, comma seperated and inserted into that one field correctly.

(Example)

If the 4 text boxes have the following values:

In the database field they become:

However, if the form is closed and then re-opened, each text box displays the entire database field rather then each value seperated in the corresponding text box.

(Example)

All 4 text boxes display this:

I already know why the data appears like this in the form, my problem is that I'm not sure how to write the javascript to seperate the values into the correct corresponding fields, assuming javascript is what I should be using!

Also, this is kind of irrelevant but just in case you're wondering, this form is part of a cold fusion application!

View 3 Replies View Related

JQuery :: Submit And Reloading Form Values After Submit Button Is Clicked?

Jul 13, 2011

In the following .submit function, I am attempting to grab the value of the selected option in the facilityCodes dropdown list when I click the submit button and then during the submit function,select the facilityCode again in the dropdown list when the page reloads and then disable the list so that the user cannot change it.However,the situation is when I reload the page after the submit button is clicked the dropdown defaults to the first option and the list is enabled.I apparently am not understanding how.submit works so that I'm selecting the option I'm defining in my code below and then disabling the list AFTER the page reloads due to an error on the page. My question is how can I accomplish this?Here is my code:

$(function() {
$("#ARTransferForm").submit(function() {
var msgsCount = 0;[code]....

View 1 Replies View Related

Ajax ::Submit Inputs Values Using Normal Button / How To Keep And Clear Values

Apr 15, 2010

In part of my form, I have 3 inputs (one textarea and two text inputs),I am validating their value format using AJAX (each input triggers error message on its label in case format is wrong). Also I have one button, "NOT submit button" (type = button).Now, when clicking on the button it must enter the value of those three inputs in my database in case they are true then all inputs values must be cleared. In case AJAX validation is wrong and in case the user clicked on that button, the value of fields must kept as it is.

Actually I can not use submit button because I have it for the whole form and what I am taking about is a part of the form and it's not possible to make nested forms as I know it violates html rules. It's easy to make it if I am taking about submitting button as I can view session values on fields after submission in case ajax returns error.I can clear inputs from Javascript, but it will be cleared on both cases if AJAX validation true or wrong. Each input field has AJAX Error message that will be triggered when the input format is wrong.

View 3 Replies View Related

Add Values From 5 Drop Down Boxes?

Feb 17, 2010

i'm trying to develop a code for my sister, i would like to use javascript
to finish off the following task:

1. I want to be able to select marks from 0 to 30, from 5 drop down boxes.

2. and as marks are selected, it should upgrade the total.

3. and then show me the total marks when finished.

i've got up to creating the drop down boxes, now it's just adding the values once selected.

View 13 Replies View Related

Onchange Submit Not Working?

Oct 5, 2006

my javascript on change event submission is not firing,

<form method="get" name="frmSummary">
<select name="dRangeStart" class="selector_wide" onChange="this.frmSummary.submit()">
<option value="10" selected>:: Please select ::</option>

[code]....

View 8 Replies View Related

Get Multiple Values OnChange?

Apr 23, 2010

I'm trying to figure out how I can pass multiple values to my javascript from one selectbox. code...

As you can see the product_id get passed to the javascript, but it is essential that I get the price and color id passed along... Is that possible, and if yes.how?

View 5 Replies View Related

Get Values From Several Textfields OnChange

Jan 9, 2010

I have a scenario with 3 x 12 textfields and looking for a javascript that could do the trick.

What I'm looking for is a smart way of extracting the values of the first three textfields and then multiply them. This will be done for all 12 rows.
I then would like to add the result from the 12 rows together to create a final value that will be presented in a seperate textfield.

row1=value1*value2*value3;
row2 =value1*value2*value4; and so on....untill row12.
then row1+row2+...row12

To show you what I mean I've created a small page with 3 x 2 fields at this link: [URL] The idea is then to have 12 rows and not two. Also - it should call for the function onChange.

I guess combind all the values in three seperate arrays, multiply and then add the values together could do the trick, but so far I havn't manage to do this.
Maybe a for(i<12)-code could help.

View 7 Replies View Related

Adding The Values In Text Boxes

Jul 20, 2005

I have a large form, that has text boxes of numbers in rows and
columns. I need to sum the values in the columns, and put the total at
the bottom of the column. But I also need to sum the values in each
row, and put the total at the end of the row.

What is the javascript to sum the values to a few text boxes, and how
would I write the script for these totals to run all at once?

View 1 Replies View Related

Total Up Values In Text Boxes

Oct 14, 2009

in my webpage, i've a form which contains several textboxes and a submit button. all the textboxes are generated using php looping method.so, what i wanna do is, when user click the submit button, it will sum up all the textboxes values and pop up alert message telling the total value.

View 6 Replies View Related

Copying Values In Text Boxes

Jan 3, 2011

Is there a shorter and cleaner way of performing the following:The objective is to get the value/input from the first set of textboxes in the form and copy them to other set of textboxes.

View 4 Replies View Related

Save The Text Boxes Values

Nov 3, 2011

I have created the text boxes dynamically(as many boxes as the user wants) and he can drag and drop the text boxes in the page. I need to create a dynamic line from one text boxes to other text boxes and delete the test boxes which the user does not want. I have created the dynamic graphic line. I know the values of the text boxes can be saved using php in the backend. But is there any way the values with the dynamically created boxes(with <div></div> elements, not with the text boxes) with values and graphics line can be saved online and the user when log-in again can retrieve the work that he saved? Can we code this either in javascript/php?

View 4 Replies View Related

Save The Text Boxes Values?

Nov 3, 2011

I am doing a website project and I am currently designing product page.

I have created the text boxes dynamically(as many boxes as the user wants) and he can drag and drop the text boxes in the page.

I need to create a dynamic line from one text boxes to other text boxes and delete the test boxes which the user does not want. I have created the dynamic graphic line.

I know the values of the text boxes can be saved using php in the backend.

But is there any way the values with the dynamically created boxes(with <div></div> elements, not with the text boxes) with values and graphics line can be saved online and the user when log-in again can retrieve the work that he saved? Can we code this either in javascript/php?

View 9 Replies View Related

Adding Values From Selection Boxes?

Jan 11, 2010

I am trying to take the values of 2 or more select boxes, add them together and then update a text field each time a selection in one of the select boxes is made. Basically, I am trying to keep a running total.

Currently I have it set up so that onchange it grabs the selected value. The problem is that it is being processed as a string I believe. For instance, if there are two variables, a=111 and b=222, the output in the text field reads 111222. I tried using parseInt, but that just returns NaN (not a number?...just a guess).

I have seen this solved with if statements, grabbing the selected index # and then assigning an integer, but I am hoping there is an easier way.

View 12 Replies View Related

Getting Check Boxes To Direct Where The Submit Button Goes?

Dec 24, 2009

I have 3 check boxes and one submit button when the submit button is hit I need it to direct to one of 3 pages depending on which check box is checked.

View 10 Replies View Related

Compare Values In Multiple Text Boxes

Apr 5, 2006

I've a page where I'm calling record from Database. Each record has an
ID and a text box displayed on the page. When the user fills in the
values of a text box, depending on the values of the text box i've to
do some further work. For eg. I've to add two records if the textbox
value of 2 records is same.

I'll try to create an example here
<-----this is from the DB-------> <-----this is form field--->
ID Task Hrs text box
1 adsfsd 1 a <---- user fills this
2 asdf 1.5 b <---- user fills this
3 eyst 2 a <---- user fills this
4 dghjfghj 2 c <---- user fills this
5 xdfb 1 b <---- user fills this
6 tyety 1.5 c <---- user fills this
________
| Submit |
--------------

So the user has to add hrs of those boxes for which have same values
entered by user. such as adding hrs of record 1 and 3 since both have
"a" entered by the user, adding record 2 and 5, as both have "b"
entered by the user and so on and so forth.

View 2 Replies View Related

Send Dynamic Text Boxes Values?

Apr 28, 2009

i am inserting values using AJAX.for single record its working fine. but i want to use five text boxes for the same function and for each text box i am calling same function.but now value are not passing properly..whetever passing first time only that value is going into database twice or how many times i have entered the values .so i want my function should work dynamically.with each add button should take value for that text box only.

here is my code

Code JavaScript:
// Optional: Show a waiting message in the layer with ID login_response
document.getElementById('insert_response').innerHTML = "Adding..."
// Required: verify that all fileds is not empty. Use encodeURI() to solve some issues about character encoding.

[Code].....

View 3 Replies View Related

Sum Values Stored In An Array Of Text Boxes?

Nov 30, 2009

how to sum the values stored in an array of textbox using javascript and display it in a separate text box.

View 7 Replies View Related

Adding Values To Dynamic Text Boxes

Apr 23, 2011

I'm a complete beginner to JS and have been playing around with a few test projects but I am stuck with one particular part.It simply creates a new text box if you press the Add Text Box button, and removes the text box if you press the Remove Text Box button.What I want to do now is add a usable value to each text box (e.g. the first text box will have the value "tb1", the second "tb2" and so on - so that I can post the data to use it further on.

View 3 Replies View Related







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