Help Making HTML Drop Down List Go Into Javascript Code

Sep 27, 2010

I have some code to pick a wire size and conduit size from 2 separate drop down list. Then inside the js it is evaluated to decide how many wires. My problem is I can't figure out how to make the drop down options go into the JS. I just put in an error alert to test if they were for now.

Here is my code:

function fillcap(){
var wire = document.getElementById("wireSize");
var conduit = document.getElementById("conduitSize");
if (wire.option.length >= 10 && conduit.option.length == .5) {
windows.alert("Wire Size exceeds conduit max fill!")
}

And the html

<h2>Fill Capacity</h2><br>
<b>Wire Size</b><br>
<select id ="wireSize">
<option value="1">#14</option>
<option value="2">#12</option>
<option value="3">#10</option>
<option value="4">#8</option>
<option value="5">#6</option>
<option value="6">#4</option>
<option value="7">#3</option>
<option value="8">#2</option>
<option value="9">#1</option>
<option value="10">1/0</option>
<option value="20">2/0</option>
<option value="30">3/0</option>
<option value="40">4/0</option>
<option value="250">250</option>
<option value="300">300</option>
<option value="350">350</option>
<option value="400">400</option>
<option value="500">500</option>
<option value="600">600</option>
<option value="700">700</option>
<option value="750">750</option>
</select> <br>
<b>Conduit Size</b><br>
<select id="conduitSize">
<option value=".5">1/2</option>
<option value=".75">3/4</option>
<option value="1">1</option>
<option value="1.25">1-1/4</option>
<option value="1.5">1-1/2</option>
<option value="2">2</option>
<option value="2.5">2-1/2</option>
<option value="3">3</option>
<option value="3.5">3-1/2</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
</select><br>
<input value="Wires allowed" onclick="fillcap()" type="button">
<input type="text" name="myresultbox" id="resultbox10"> Wires<br>

Thank you for any advice.

View 2 Replies


ADVERTISEMENT

Incorporating Code Into A Html Drop Down List Box?

Aug 11, 2010

With the code pasted below prints three different dates as outputWednesday, August 11, 2010hursday, August 12, 2010 Friday, August 13, 2010The code displays todays date, tomorrows date, and the following day code also excludes weekends.The problem I am having is being able to take each date and place it as an <option value = in an html drop down list boxIs there anyway I can incorporate these dates as option values in a list box for the user to selectHere is the JavaScript code below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

[code]....

View 3 Replies View Related

Get Values From Form.html(textbox) To Test.html(drop Down List) ?

Feb 6, 2011

I would like to ask how do I get the value from a textbox from form.html which contains my iframe and copy the value into another page, test.html ?

View 2 Replies View Related

Redirect Url Using Javascript In Drop Down List

Jul 23, 2005

How can i use javascript to redirect the url in the drop list box once the event onchnage is triggered?

View 1 Replies View Related

Removechild - Create A Drop Down List Which Depend To The Value Selected From The Previous Drop Down List

Jul 28, 2010

I am trying to create a drop down list which depend to the value selected from the previous drop down list. I can add it without problem, but If I change again the value of the first drop down list I would like to remove the previous drop down list generated from the first value. If I try to remove it when I create the element, it even does not create the element, the remove element function seems to work because when you click on the remove link it works.

[Code]...

View 4 Replies View Related

Viewing Javascript Generated Html Code

Jul 20, 2005

I was wondering if there was a way to view the html code that javascript
produced since viewing the source code shows the javascript if statements
for netcrape and IE etc.

View 1 Replies View Related

JQuery :: Null - Undefined - Empty - Drop Down Option Is Selected In A Drop Down List ?

Oct 25, 2011

I am asking jQuery to tell me which drop down option is selected in a drop down list - like this:

I would like to check if this was successful before I proceed. What are the possible return values for this statement?

If no id exists.
If no option is selected.
If some other problem occurred.

In these cases am I expecting a null return; an undefined return, a false return value?

And, based upon the complete set of return possibilities, what would be the best and most comprehensive tests I could apply to cover every base.

View 4 Replies View Related

Multiple Drop Down With Dynamic List (PHP - MySql - AJAX) - Filter The Results Into A List

Aug 2, 2011

I have a table that has parts with multiple characteristics. Part Number, Height, Width, Capacity, Price, Etc. I would like to have a drop downs for all of these values, when a user selects one of these values it will filter the results into a list. Ex. user selects a part that has a Height of 6 and width of 10 it will only list those parts. As I said earlier, I have a script that will give me all the parts, however I am not able to make the onchange list parts with multiple values.

View 9 Replies View Related

JQuery :: Limit If A Value Can Be Selected In A Drop Down List (select) Based On Other List

Jun 9, 2009

I have a page that displays a list of people playing in a tournament. I need to be able to generate a Leaderboard based on which players are manually selected by the admin. Next to each person there is a drop-down list. An admin can go in and select a "slot" that a player should be in on the leader board from 1 to 8, or leave it blank if none. What I need to figure out how to do is the following, when a change event happens on a drop-down list, and say the value 5 is selected, I need to check to make sure that 5 is not already selected in one of the other players drop-down lists, in other words, that the 5th leaderboard slot is not already full. if it is, display an error message and make them change that one first. how to do that with jQuery? I'm thinking it will have something to do with the each() function, but not sure exactly how the logic should work.

View 4 Replies View Related

PHP Drop Down List Selection Populates Second Dropdown List Or Text Box?

Jul 13, 2011

I have been struggling on a bit of code for a while now. I need to populate a second drop down list (Region) based upon the selection of the first (County).I have found a piece of code that works on its own and have adapted to suit my needs - see below. However, when I drop it into my main page the javascript is not working. It's because of the formObject but I just don't know enough to resolve this! Furthermore, I need the textboxes the user has already completed in the form to retain their value once the javascript kicks in as the completed form will submit to a database.This piece of code is working well . . . .

<?php

$link = mysql_connect('myhost', 'myusername', 'mypassword') or die('Could not connect: ' . mysql_error());
mysql_select_db('mydatabase') or die('Could not select database');[code]......

View 2 Replies View Related

Making A Drop Down Search Box?

Dec 15, 2010

making a Drop down search box I have dropdown HTML code and also Search Box HTML code, I made sample code but not sure why its not working, please do the need full

<HTML><HEAD><SCRIPT type="text/javascript">
function searchSel() {
var input=document.getElementById('realtxt').value.toLowerCase();

[code]....

when I start typing in search box the name (like google), drop list box should also change and when clicked on GO should go to the following link

View 4 Replies View Related

Making A Drop Down Menuline?

Jul 14, 2011

I have created a menuline with HTML and CSS and now I want to make it so that when you hover over the link in the list item it drops down revealing more options.Here's my HTML:

<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 StrictEN"
"http:www.w3.org/TR/xhtmli/DTD/xhtmli-strict.dtd">
<html xmlns="http:www.w3.org/1999/xhtml">

[code]....

View 2 Replies View Related

Making Drop Down Menu With Submenu

Jul 20, 2005

If I select one of the menu items the submenu appears just fine, my only
problem is that If I point the mouse curser away from the whole menu the
submenu is still shown, obviously if I click once with the mouse outside the
menu the submenu disappears. So I need some kind of remove-submenu function
when the mouse pointer is not pointing on menusubmenu....

View 1 Replies View Related

Making A List Read-only

Jul 23, 2005

I'm having difficulty making a list (both drop down and radio button) read
only; I am successful when I attempt to make a text field read only. Any
suggestions on what java script I use to accomplish this?

View 1 Replies View Related

Making A Comment Box Drop Down On Link Click?

Nov 11, 2010

I have this loop I run to retrieve wallposts with php. Within this loop, I want a link/button on every post that says "comment". When the user clicks the comment link I want a comment field and post button to appear on the post I clicked on. The problem is that when I've tried making a link that does this, it only drops down the comment field on the most recent wallpost regardless of which wallpost I click on.

View 3 Replies View Related

Making A Dynamic Form List?

Oct 21, 2010

What I need to do is create a dynamic select list using several sets of arrays.Example: fav color, fav car and fav genre.The trick is I need to use three radio buttons to control what is seen in the list.So if a user click radio button 1, the list changes values to one of the arrays.And if they click radio 2, the list changes to the values to another array.This is a learning process. I will really appreciate if anyone can help me on this.I can build the arrays, what I do not know how to do is make the list dynamic so that it fetches data from the arrays when a radio button is clicked.

View 5 Replies View Related

JQuery :: Making Vertical Superfish Menu Drop Left?

Jul 17, 2009

Is there anyway to make a vertical super fish menu drop left? I have positioned the menu on the right side of the page so, I need sub-menus to drop left. Is this possible?

View 1 Replies View Related

JQuery :: Making Drag / Drop 'gallery' With Savable 'cart'

Feb 27, 2011

A page with drag/droppable images. When an image is dragged to a "cart" (a div), the script gets the value of that image (say $30) and saves it to that particular uses "cart".When they refresh, the image remains in the cart. Images need to be able to be removed.Also, the values are added together in the "cart" to give a total. When if this total exceeds a predefined limit within the script, no more images can be added and the gallery items "grey" out (maybe).Or at least pointing me in the correct direction?But the tutorial doesn't include a php file or the ability to save items to database per user.

View 1 Replies View Related

Dynamic Drop-down List - Create A Dynamic Menu Where A User Selects One Item And Another Select List Is Shown

Jun 30, 2009

I've been beating my head against a wall for a few days trying to get this working. I'm trying to create a dynamic menu where a user selects one item and another select list is shown, then another and another (and so on). Here is my JS, it *should* be taking the ID of the div, comparing it to the selected value and then showing another div by settings it's class property to visible:

[Code]...

View 1 Replies View Related

Making Ordered List Numbers With Onclick Display Prompt?

Feb 13, 2009

Is is possible to make an ordered list with an onclick display prompt show the number item of the list? What I mean is like, say I have 29 items, but I click on item 15, is possible to make the prompt show the number 15, or the correct number for any item I pick?

View 2 Replies View Related

Making A Pdf Out Of Javascript

Oct 23, 2007

is it possible to create a pdf file using javascript language?

View 1 Replies View Related

Making My Own Attibutes For HTML Tags

Jul 20, 2005

Is there some way to access an attribute to a tag that I've made up? Eg:
<INPUT type="text" name="phone" size=12 validate="area_phone_au">

I can get the type using:
document.formname.phone.type

But I don't seem to be able to access the 'validate' attribute:
document.formname.phone.validate

Anyone know if there's a way? If there's not, is there some other simple way
to specify validation information for a field? I could do something like:

<INPUT type="text" name="phone" size=12>
<SCRIPT> add_validation(document.formname.phone, "area_phone_au") </SCRIPT>

<INPUT type="text" name="state" size=4>
<SCRIPT> add_validation(document.formname.state, "format:AAA?") </SCRIPT>

The 'validate' function would then store the reference to the field and the
validation information. On submit, we validate all the fields by searching
all the references to see if they're in the form we want. (Have to work
that one out too!)

I'd prefer not to have to add script elements to do the validation. I'd
prefer to be able to store it in an attibute to the field. Of course I
could add it to an eventhandler for the field such as:
<INPUT type="text" name="state" size=4 onFocus="add_validation(this,
"format:AAA?")">

But that's still messier than I'd like it. Of course, all JS cases,
add_validation would have to check to see if it already knew about the
field!

View 1 Replies View Related

JQuery :: Code A Page With Code - User To Be Able To Move Html Elements Around

Mar 23, 2011

I am trying to make a gui for clients to edit a php page that displays html and javascript.

I want the user to be able to move html elements around and even edit it like add effects like fade in and out etc.

Then after all the changes I want to overwrite the existing php file that does this for that user. how can you make such changes and then save it to a file?

It's an html / javascript editor but using a gui instead of allowing them to directly touch the code. It would be a security risk if I allow such a thing. So I need to program a interface that would make such changes and save them to file.

Like how can you delete and add new javascript code to the file?

View 3 Replies View Related

Drop Down List - Each Select Drop Down Should Not Allow The User To Select The Same Language Again

Feb 25, 2010

iam trying to use 5 drop downs in my form for user to select languages and each select drop down should not allow the user to select the same language again and all my drop downs are populating individually from the DB on the page so if "English" is selected for "dropdown 1" then again "drop down 2" should not allow "English" to be selected.

View 3 Replies View Related

Making HTTP Requests With JavaScript

Aug 24, 2007

I'd like to make an HTTP request using JavaScript but not with the XMLHttpRequest object. I'm attempting to make this request to a different domain to get information and the security of modern browsers won't allow this with the XMLHttpRequest object.

Is there another way to do this in JavaScript? Oh and I'm not taking advantage of the asynchronous nature that object either, so that's not a criteria for a potential solution.

View 1 Replies View Related

Html Lists Making Array - Remove The Ul Inside

Dec 30, 2009

HTML UL I have ul inside ul but all I want to get when I select a certain list is the children of that list but remove the ul inside that list so they dont show at all [URL]

<div class="demo" id="demo_1">
<ul>
<li id="1" class="open"><a id="1" href="#"><ins> </ins>Root node 1</a>
<ul>
<li id="2"><a id="2" href="#"><ins> </ins>Child node 1</a></li>
<li id="3"><a id="3" href="#"><ins> </ins>Child node 2</a></li>
[Code]....

View 3 Replies View Related







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