Evaluate Drop-down Based On Text?
Aug 31, 2009
Curious about the following issue. I currently have a dynamic drop-down based on the value of each option.. If selection in top drop-down is B it will show all options with a B contained in the second/resulting drop-down.
Now - I also want to evaluate the options by having the script check for a few keywords..
Example - have it evaluate the drop-down on page load for options with text containing 'blah123' (ex. <option value="0323G">Qwerty - blah123</option>). And if any of the options have that text the script will generate an additional drop-down menu allowing you to select blah123 or other specified text. Say another thing I'd like to search each text string for is 'abump'. If there is 'blah123' and 'abump' contained within the drop-down, a third drop-down menu will be generated (as said before) with only blah123 and abump as options. Whichever of these is selected will narrow down the options available in the final drop-down menu.
View 4 Replies
ADVERTISEMENT
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
Jul 20, 2005
I'm trying to show/hide a simple piece of text and a text field on a
form based on what choice is made from a drop down box.
<select name="dropdown" size="1">
<option selected value="">Please make a selection</option>
<option value="1">Choice 1</option>
<option value="2">Choice 2</option>
<option value="3">Choice 3</option>
<option value="4">Other</option>
</select>
i.e. if Choice 2 is selected I'd like to display a new <tr> with the
following:
<tr>
<td>New text field:</td>
<td><input name="newField" type="text size="20"></td>
</tr>
if any other choices are made, I don't want to display anything.
I've tried several onchange() functions but can't achieve what I'm
looking for.
View 6 Replies
View Related
Jun 26, 2006
I've got 2 drop down select lists. The first one would have something like
-Category 1
-Category 2
-Category 3
Then what I'd like to happen is when you select one of those categories the next drop-down below it loads something like
--Sub Category 1
--Sub Category 2
--Sub Category 3
Any idea how I'd pull that off?
View 1 Replies
View Related
Jan 7, 2010
I have a simple html form that asks a user to select a state from a drop down list. Later, in the same form, there's a question that needs to display an image of the state they previously selected from the drop down menu. How can I accomplish this using javaScript?
View 12 Replies
View Related
Jul 18, 2009
I have a javascript function that will load a CSV file in to a grid:
Code:
function load(url){
table.setURL(url);
table.request();
}
<button onClick="load('URLTONEWFILE.CSV')">Load New File</button>
This works perfectly, however I need to take it a step further to load CSV files, based on user choices from two drop down boxes. Something like this:
Code:
<form name="myform"">
<select name="mycolour">
[code]....
View 1 Replies
View Related
Nov 17, 2010
This code is able to display a table and show me state, County, Genus and GenusCount and also it shows when I select option as All for Counties in my drop down. it can based on which it can change my table and give me State, all the Counties, its Genus, GenusCount but when I select a particular County and then select for genus in my drop down menu. It is not working correctly. This is my code.http://paste.flingbits.com/m58f9160Example: If I select `Tennessee->Anderson->All` it should display in tables
<pre>
_____________________________
|State |County |Genus |
[code]....
View 1 Replies
View Related
Aug 25, 2010
I'm trying to build a string based on three drop downs. As each drop down choice is made, I want to append the string and redisplay it. When finished the string will be a complete (but not hyperlinked) URL.
My drop downs look like this:
HTML Code:
PHP Code:
Here's how it supposed to work...
When an admin has used the first drop down to pick the value of the "first" variable, the string is updated and redisplayed like so:
Next, when an admin has used the second drop down to pick the value of the "second" variable, the string is updated and redisplayed like so:
Finally, when an admin has used the third drop down to pick the value of the "third" variable, the string is updated and redisplayed like so:
That's all I have. I'm stuck. I'm guessing I need an "onChange" event with each drop down? Also, I need to refresh the "makeTheLink" div when an onChange event fires? How do you tie all of this together? Is self rolled JavaScript the best solution or would jQuery be better?
View 4 Replies
View Related
May 18, 2006
I've got a drop down with a listing of categories (Books, Apparel, Music, etc) for adding products to a database.
When the user select "Apparel" I want it to reveal a <div> with extra options. But I "only" want it to respond to if apparel was selected. If books, music, etc are selected, it should do nothing.
View 1 Replies
View Related
May 16, 2010
I need to be able to change the fields of a form based on a drop-down list. Like if someone picks option A field 1 shows and if they change it to option B field 1 and 2 show up without reloading the page.
If you need me to explain more I will try to do a better job. If I could be pointed in the general direction that would be great, I dont exactly need to be spoon-fed, although I do like spoons if you catch my drift .
View 2 Replies
View Related
Feb 17, 2009
I have a property site and I currently have it set up do that when entering a property the person selects a country.Depending on the country selected, the town drop down populates with certain towns in that country.ecause of the number of countries this javascript is pertty large and that worries me slightly. Also, if someone hasjavascript turned off then it doesn't work.In order to make it more accessible, would I have to seperate the form into 2 sepertate pages.
View 1 Replies
View Related
May 23, 2011
I'm using PHP / MySQL / javascript (very new to javascript)I'm looking to set the value of a textfield based on the name (NOT value) of a drop-down. The drop-down is created dynamically from a recordset (see code below):
<select name="mainStory" id="mainStory">
<?php
do {
?>[code].....
View 6 Replies
View Related
Nov 26, 2006
Does anyone know of a Javascript that will show an amount in a drop down based on what was selected in the previous drop down? Example: Code:
<select id="car">
<option value="volvo">Volvo</option>
<option value="audi">Audi</option>
</select>
<select id="price">
<option value="">Please select</option>
<!-- show this if volvo -->
<optgroup id="vol">
<option value="30000">30000</option>
<option value="31000">31000</option>
</optgroup>
<!-- show this if audi -->
<optgroup id="aud">
<option value="40000">40000</option>
<option value="41000">41000</option>
</optgroup>
</select>
View 9 Replies
View Related
Jun 5, 2009
Just wanna show of our portal system based on DotNetNuke <span class="il">jQuery</span> and jQueryUI We took the sortable example and modified it with up down movement animation slide into place smooth animation drag to delete and click to delete restore functionality
[Code]...
View 1 Replies
View Related
Feb 13, 2006
I am setting up a contact form, and want to have a drop down box with a handful of options. Clicking one option should display fields to input username & password, whereas all others will not. So far, I've tried and (replacing 'none with 'block' for the option that is supposed to show the input fields) but neither does what I need it to. I'm fairly new to javascript, just muddling my way through with the aid of tutorials.
View 2 Replies
View Related
Oct 16, 2010
I have triple drop down menu. I want to display the contents of the table based on the third menu selection. The code is in the link [URL]
I know I need to include a onchange function to <select name="genus"> but as you can see I have a <div> already for it. I am confused how to create the function to display the table and also the how to include another div tag.
View 1 Replies
View Related
Oct 14, 2006
i would like to evaluate a xpath expresion inside an iframe.
this is what i do :
1. find the iframe :
var f = document.getElementsByTagName('iframe');
2 evaluate the expresion :
var iterator = document.evaluate("//a", f[0], null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
var aElement = iterator.snapshotItem(0);
alert(aElement);
the problem is that this expresion gives me the anchor of the root document, not the anchor inside of the iframe.
View 6 Replies
View Related
Nov 3, 2010
I have a script that will loop through all the INPUT elements of a form; if the input is a submit it will disable the submit (or enable the submit, depending upon what is passed to the function.) I hate using eval() - I avoid it whenever I can! Is there a better way to dynamically process the ".disabled = 'true'/'false';" portion?
[Code]..
View 7 Replies
View Related
May 2, 2011
I am trying to use it to direct users to a search page based on the values of two drop down boxes. The issue i am having is that the code below works fine on a test page, but not on my test domain (with wordpress theme) and so i was wondering whether there is anything I am doing wrong... Is onclick already defined maybe? I'm not sure how it works to be honest... :(
<script type="text/javascript">
function gosearch() {
var breed = document.getElementById('breed').value;
var area = document.getElementById('area').value;
var site = "http://hairloss-help.net/?s=";
var searchurl = site + breed + area;
[Code]...
View 7 Replies
View Related
Mar 12, 2010
I need to a code to do the following.
There is a Text Area that user can enter text. assume that user enter something and put a dot Following values should be populate in a drop down at the place where dot locate .
like when we get the string object using Net Beans IDE and when we put "Object." , drop down will be displayed with available methods for that particular object. idea is to build a editor using java script.
View 1 Replies
View Related
Nov 21, 2006
I met a problem when using document.evaluate() to get text content
using XPath, my code is as follows:
nodes = document.evaluate("/html/body/div/ul[1]/li[5]", document,
null,XPathResult. UNORDERED_NODE_SNAPSHOT_TYPE , null);
in the XPath expression "/html/body/div/ul[1]/li[5]", I need to
traverse from li[1] to li[5],
so I should use a variable here , like this:
for (index =1; index<6; i++)
{
nodes = document.evaluate("/html/body/div/ul[1]/li[index]", ....);
// the variable index here is invalid!
}
my question is: How to use the variable in XPath expression?
View 1 Replies
View Related
May 7, 2009
The following example works great in Firefox, and Chrome but fails miserably in IE (6,7,8). I'm running JQuery 1.3.2 if it makes a difference:
$('resp',"<root><resp>value</resp></root>").text();
That evaluates to "value" in everything except IE.
View 3 Replies
View Related
Dec 31, 2007
I have built a page on a recruitment website which allows users to upload their CV via ASPUpload i.e a browse button. However I want to limit the file type to just MS Word documents as I do want them uploading large PowerPoint files etc. My idea is to have some javascript which evaluates the last 4 characters of the file name to ensure it is .doc
So if they try to upload anything other than a .doc file a dialogue box will appear stating that they must only upload MS Word Document (when they click the ‘Upload CV’ button).
Does anyone know how I can evaluate the last 4 characters of the file name? Once the user has browsed to their CV on their PC the path & file name will appear in a text field called ‘CV’.
View 6 Replies
View Related
Jul 23, 2005
I don't know how to evaluate the no-blank selections against each other from a form as follows: .
I have a form with 6 dropdown fields, each containing a selection of 30 options (the 30 options are the same for each dropdown list). The user needs to select 'one of the 30 options' from each dropdown selection, but each option they select must be unique (no duplicate selections) or it must be left blank. E.g. The user can select Option3 within "dropdown1", but must select a different option for the other dropdowns - OR leave them unselected.
View 10 Replies
View Related
Oct 18, 2009
I am returning the present time - then using the .substr to remove all digits except the last two on the right (i.e effectively returning the value 32 from 65344532) I am then looping, subtracting 11 from that number until the value is less than 11. The intent being to then return the value from the appropriate matching array ID code...
The problem arises with evaluating two digit numbers beginning with zero - In cases where the last two numbers are greater than 09, the looping returns a 1 digit number for valuse less than 10, in cases where the last two digits begin with zero the loop will not begin. I have attempted to use the switch(n) to determine if any 01, 02, 03 ... etc exists but this is not evaluating correctly - is this due to using the date/time object and if so is there a good way to convert this to either a numeric or string datatype where the case can be evaluated correctly?
View 11 Replies
View Related
Jan 20, 2010
I am trying to populate page elements from an AJAX call, which returns JSON.
For some reason, JSON that looks like this, fails to evaluate, I'd like to understand what's wrong with it.
JSON:
Code:
View 2 Replies
View Related