Setting Multiple Text Field Values Based On Select Choices?

Jan 13, 2009

I'm trying to do something that is slightly complex and I can't find any relevant examples in the usual places,I'm pulling a list of projects (and their IDs) into a select:

Code:
<select name="proj_id" id="proj_id" onchange='setValuz()'>
<option value="1" >1st Project</option>
<option value="2" >2nd Project</option>
</select>

Each project has two associated values, in addition to the unique ID:

[Code]...

Can anyone shed some light on how I could do this? Maybe a link to a "how-to" (if there is one out there)?

View 3 Replies


ADVERTISEMENT

How To Add Multiple <option> Values From A <select> Into A Text Box

Oct 25, 2005

What I'm trying to do is get multiple options from a <select> list, and display the values in a text box. So here's my select:

<select name="js_strPreDefCatList" size="6" multiple="MULTIPLE" class="formtext">
<option value="All content">All content</option>
<option value="Region: Africa">Region: Africa</option>
<option value="Region: All Americas">Region: All Americas</option>
<option value="Region: All Europe">Region: All Europe</option>
etc.....
</select>

'// Followed by my button

<input name="Add1" type="button" class="formtext" value="Add" onClick="addPhrase()">

'// Then the TEXTAREA

<textarea name="js_strMemberMail" cols="40" rows="1" wrap="VIRTUAL" class="formtext"></textarea>

The function "addPhrase" is where i know i'm having the difficulty - so for now I've forced it to show one value only:

'// The form name is AMANDA

function addPhrase() {
document.AMANDA.js_strMemberMail.value = document.AMANDA.js_strPreDefCatList.value + ", " ;}

What I think I want is to be able to build up a string of values and write them out to the textarea (hence the ", "). With the option that more can be added, without deleting what's currently there.

View 9 Replies View Related

Adding $ Values In Drop Down Choices And Totaling In Html Form?

Feb 17, 2010

I am creating a html form for the local soccer league for online registration. In a drop down box the user chooses whether in house or travel and both choices have a different fees ao I would like to add a $ value to both options to be displayed in a TOTAL box at the bottom of the form before they submit. I would (if possible) like to have that total displayed on the page they are directed to after submitting the form. This page will have a link to PayPal for the user to pay their fee or I could skip that step and have the user taken directly to PayPal checkout with that total already filled in. Is this at all possible? What are my possiblities? I am NOT any where near a pro at the code writing. I can provide a link to what I have done already if requested.

View 3 Replies View Related

Change 2nd Select Values Based On 1st Select?

May 4, 2010

I am working on a class registration system that requires students to register for a main class (101, 102 or 103). The student is supposed to select one main course as well as provide a second choice in case the first is not available. I have two dropdown select fields to capture data

1) Choice -1: 101 / 102 / 103 ( Student needs to select one - Reading the classID from classes table)
2) Choice -2: 101 / 102 / 103 ( If student selects 101 in Choice-1 then the only classes available under Choice-2 should be 102 or 103).

How can I accomplish the above? Further to this there are two fields on the form where I would like to auto populate based on what they have selected in Choice-1 and Choice-2.

For Example:
If a parent selects choice1: 101 the child Choice1 field should autopopulate with 100.
If a parent selects Choice2: 201 the child Choice2 field should autopopulate with 200

View 6 Replies View Related

Dynamically Showing Field Based On Text Value From Another Field?

Nov 18, 2009

I have a text field, call it income, that when the input is > 0 I need to dynamically show the next text box, and if it is blank hide the next text box. I would like to use onBlur but can't seem to get it to work.

View 5 Replies View Related

Setting Of Text Field Value To That Of Url?

Jul 25, 2009

If you click the link on [URL].. a form pops up. How do I set the value of the URL text field in the form to be equal to the url of the page it originated for i.e in this instance it the value would be[URL]... i believe would set the value to the current url. What I need is the value of the url the pop up originated from.

View 17 Replies View Related

Jquery :: Select All Values Of A Multiple Select List

Jun 23, 2009

is there a way to select all values of a multiple select list by default?

View 3 Replies View Related

Select Values Of One Select Box Based On Values In Second?

Jan 9, 2010

I've got two select boxes with same options and same option values on my page, i want that whichever options a user selects from first box, should also get selected in second box. I need to get this done in Javascript or without using advance jquery methods.

Please suggest me is there a way to do this?

View 1 Replies View Related

Pre Populate Text Field Based On Another Text Field

Jan 23, 2010

I'm developing a web page. It includes 2 text boxes. One text box for city and another text box for std code. I wrote the code for auto suggestion to city. Now i want to pre populate the STD code when ever a known city is selected (when city is selected from the recommendations displayed for city field).

View 8 Replies View Related

Setting Text Field To Accept Only Alphabetical Characters?

Oct 26, 2008

I am unable to solve two problems creating a contacts form using dreamweaver CS3. My other problem is posted under the heading, "Modify code created with Dreamweaver CS3, to compare two text feilds". For this posting, can someone please tell me how to modify my code, pasted below, so that the "First Name" and "Last Name" text fields are restricted to accepting only alphabetical characters.

Here's my current 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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

[Code]...

View 2 Replies View Related

Populate Form Field Based On Select Option?

Jan 14, 2009

Is there some example js that shows how to populate a text field on a form, based upon what option is chosen in a select form field? The options can be hardcoded and it would be great to also have a default if js is off on the client side.code...

View 4 Replies View Related

Menu Populates Based On Select Field Entry?

Aug 10, 2011

I am looking to build as basic as possible, a form that has 3 select dropdowns that have predetermined options. The user will select the first option and based on that option the second will populate and based on that, the third one will give the last option. Now, when the last one is selected, i need a div or a paragraph displaying information to be displayed.So here's the framework.

Option 1 = fruit or vegitables of which fruit is selected is selected by the user
Option 2 = Apples, Grapes, and pears of which apples is then selected
Option 3 = Red, Green and Yellow of which Green is selected.

Once green is selected, I need a description about the green aple to be displayed.

View 7 Replies View Related

JQuery :: Select Div Based On Multiple Condition?

Jan 18, 2011

I was wondering if anyone knew of a way of selecting a DIV based on 2 of itsattributes meeting a certain criteria. Say for example I have a variable called 'time', now if data-in and data-out (below) are 'seconds', how would you show the relevant DIV based on the 'time' variable.Assume all the below are hidden by CSS to start with.

For example if 'time'=15 it would show slide1 because it's between data-in (10) and data-out (20).[code]...

View 1 Replies View Related

Multiple Values In Subject Field?

Nov 24, 2011

I am setting up an email form & i would like the subject field to hold multiple values, the forrm will be something like this:

Name:Mr A
Date: 01/01/01
Reason:Football

I want the form to send an email without opening an email client & I would like the subject field to look like this: Subject: Mr A, 01/01/01, Football Subject Mr A - 01/01/01 - Football

Can anyone tell me if this is possible, if if is can you please point me in the right direction.

View 1 Replies View Related

JQuery :: Open/Close TDs Based Upon Select List <option> Values

Nov 3, 2011

My mission: Open/collapse TD cells based on items selected in a list box. Getting no response from jQuery so I've done something wrong but cant quite get there. Listbox 'mainselect' contains option values that refer to names of TDs in a table. When a mainselect option is clicked, it will toggle to open or close the referenced TD list box by option value. Does hide/show make a TD 'blank' or actually set it's width to '0'? I want it to close, moving other cells left.

<html><head>
<script src="jquery-1.6.4.js"></script>
<script>
$(document).ready(function() {

[Code]....

View 2 Replies View Related

Build A Redirect Url Dynamically Based On 2 Select Field Combinations Chosen?

Oct 8, 2009

I am having trouble writing this javascript for my work, normally I would do this in ASP or PHP, but the environment I am working with will only allow javascript for dynamic function.

The form has two different select boxes and based on your options selected for select box #1 and select box #2, the hidden input field "redirect" (which is currently empty) would then populate dynamically with the URL associated with that combination mentioned below. The hidden redirect input field (now containing dyanmically generated data) would then pass the new value via HTTP_POST to .net script that will handle the redirect processing step fed to it. code...

View 5 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 :: Select On Multiple Attribute Values?

Apr 24, 2009

I already know that you can combine multiple attribute selectors, &&-style, by doing:

$("*[name='someName'][value='someValue']");
However, what I was wondering is, is there any way to combine multiple
attribute selectors, ||-style, such that I could select:
$("*[name='someName'][value='someValue']").add("*[name='someName']
[value='someOtherValue']");

[Code].....

View 6 Replies View Related

Fill Value Of Text Field Based On Dropdown?

Sep 25, 2010

What im trying to do is for each item selected from the drop down, display its value in a text box (GAC). I have attached a picture of the image to clarify.

The drop down items are populated from a database, and each item has an associated GAC value. The remaining inputs are user supplied and all the inputs including the drop down item and its value are is stored in a different table in the database.

View 1 Replies View Related

Dynamic Drop Down List Based On Text Field Value

Nov 25, 2009

I have a form that has a pretty complicated combo box - a user starts typing text, it queries a database for matches, and displays the results to the user. The user can then select the match they desire and it has a value id, which I am currently sending to a hidden field in the form. So, for example: user starts typing in a movie name, Seven - it returns Seven and user selects it. The form submits the id of the movie seven (say 12) to a hidden field.

Where I am stumped: Once a user selects a movie title, I have another drop down select box that is to display the available formats of the movie by querying my database based on the product id (12) and returning the available formats in the list:

DVD
BLUERAY
VHS

I am pretty good at programming, but I cannot figure this out - how to make the select box fire and return results once the value for the textbox has been captured.

View 1 Replies View Related

Autofilling A Text Field Based On Prior Input?

Sep 2, 2010

The specific piece I'm stuck on at the moment is this:I have a form with a lot of fields, two of which are subnet (a drop box populated from a database, via PHP) and IP address (a text input box). When the user selects a subnet, the value is sent to a PHP script that queries the DB and returns the next unused IP address. If all I wanted was to display that in a div next to the IP input box, I'd be set -- that works fine.Unfortunately, I can't for the life of me figure out how to get the returned data into a text input box, which is what I actually want.I know that ocument.getElementById("div_id").innerHTML=request.responseText; will display the text in a div in my sample code. I found a post somewhere that implied that frm.getElementById("input_id").value = request.responseText; would do the job for a text input, but it doesn't, at least in any of the browsers I've tested.

View 1 Replies View Related

Auto Text Field Populate Based On Dropdown

Feb 22, 2011

I've looked around and from what I can tell, the code seems right. Basically crating a JS array and passing PHP values to it to use in an onChange to fill a text field. The dropdown gets populated fine but the text field does not autopopulate onChange. I'm not too fluent with JS but have a good analytical mind and from what I can see, the logic seems right.

<?php
include('connectdb.php');
$CENTRE = $_SESSION['centreAFB'];
$qryFormList = mysql_query("SELECT * FROM tblLogin WHERE ACCT_TYPE = '2' AND loginCENTRE = '$CENTRE' ORDER BY loginNOM");
echo "<script type='text/javascript'> var formCourriel = new Array()";
while($resFormList = mysql_fetch_assoc($qryFormList))
[Code]....

View 7 Replies View Related

Image Swap Based On Text Field Value Change?

Aug 17, 2011

i'm quite new to javascript and have an issue with an image swap script. I have three images that should change based on the value of a text field (total), however, there is only one image that is swapping. Please see the code below:

Code:
<html>
<head>
<script type="text/javascript">
//This is where we decare our function to validate the HTML form
function validateform()

[Code]...

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

Sum Text Field Values

Jul 20, 2005

Was just wondering how I can sum values from different textboxes,..
I used "+" but this adds the values together rather then creating a sum of
them.

e.g.

var x = document.clear.field1.value; (e.g. 10)
var y = document.clear.field2.value; (e.g. 11)

var sum = x + y (that comes up with 1011) rather then 21.
How can I add them together so the result is 21?

View 1 Replies View Related

JQuery :: Get Multiple Form Input - Select Values From The Same Page In Php?

Apr 14, 2011

I have multiple <select></select> elements in a php page. After an option is chosen from the first drop down <select></select> element, options of the 2nd drop down <select></select> element will show up. Selection of an option from the 2nd drop down list will get the options in the 3rd dropdown list show up. Thus input from the 3rd drop down list will show up the options in the 4th drop down list. Such is the case for the 4th, 5th ,... drop down list.

Each time depending on the inputs from the previous drop down lists , the values for the immediately later drop down list will be retrieved from the database. i.e options for the nth drop down list to be retrieved from the database will depend on the selected the values from 1st, 2nd, 3rd, .....(n-1)th drop down list.

View 6 Replies View Related







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