473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

a select value problem

In the html I have a select option. I am trying to get the result of the
selection(u5503_qty*5) to print after some text. I am having a problem
grabbing the value of u5503_qty from the html to use in the javascript. Can
somebody correct me on this?
Step 4. How many would you like?<br />
<select name="u5503_qty" size="1">
<option label="1" value="1" selected>1</option>
<option label="2" value="2">2</option>
<option label="3" value="3">3</option>
<option label="4" value="4">4</option>
<option label="5" value="5">5</option>
</select>
<br />
At this point, your charges will be....$
<script type= "text/javascript">
var y=5;
document.write(Number(document.value.u5503_qty)*5) ;
</script>
Feb 18 '07 #1
2 2074
Thad wrote:
In the html I have a select option. I am trying to get the result of the
selection(u5503_qty*5) to print after some text. I am having a problem
grabbing the value of u5503_qty from the html to use in the javascript. Can
somebody correct me on this?

<select name="u5503_qty" size="1"
onchange='document.getElementById("foo").innerHTML =message(this)'>
<option label="1" value="1" selected>1</option>
<option label="2" value="2">2</option>
<option label="3" value="3">3</option>
<option label="4" value="4">4</option>
<option label="5" value="5">5</option>
</select>
<br />
<p id="foo">Select something</p>
<script type= "text/javascript">
function message(menu){
return "At this point, your charges will be....$"+
menu[menu.selectedIndex].value+".00";
</script>

Why the labels?
Mick
Step 4. How many would you like?<br />
<select name="u5503_qty" size="1">
<option label="1" value="1" selected>1</option>
<option label="2" value="2">2</option>
<option label="3" value="3">3</option>
<option label="4" value="4">4</option>
<option label="5" value="5">5</option>
</select>
<br />
At this point, your charges will be....$
<script type= "text/javascript">
var y=5;
document.write(Number(document.value.u5503_qty)*5) ;
</script>

Feb 18 '07 #2
Why the labels?
Mick
Ignorance...I was thinking that I was needing it. Thank you so much for the
help and pointing out about the labels.

Thad
Feb 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JT | last post by:
I have an input form for which I've created a "matrix" for user input. Basically, the user chooses a radio button and then through javascript, a select box is displayed to define a value for that...
3
by: Dennis M. Marks | last post by:
I have a problem with the following code. It generates a <FORM><SELECT><OPTION> list. There is no problem in the generating. The problem is in the execution as follows. It works fine in Mac IE...
2
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
2
by: areef.islam | last post by:
Hi, I am kinda new to javascript and I am having this problem with selecting multiple options from a select tag. Hope someone can help me out here. here is my code...
4
by: Matt Ratliff | last post by:
Hello, I would appreciate any assistance you have with the following problem: I have (as an example) an array of values as follows: arrayvalues=new Array("0001","0003","0005") where each is the...
3
by: imrantbd | last post by:
This is my first problem.Please help me. I have the following code: <head> <script language="JavaScript"> function addSrcToDestList() { destList1 = window.document.forms.destList; srcList...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
9
chunk1978
by: chunk1978 | last post by:
hey everyone, i've been trying to solve this problem for 2 days straight, with no end in sight. i would greatly appreciate anyone's help. EXPLANATION: There are 3 Select Menus. The 1st and...
0
by: cmrhema | last post by:
Hi, I have two controls one html select control and one asp.net dropdownlist control. In html select control i have three maps loaded. It is loaded in the following manner. <SELECT...
5
by: viki1967 | last post by:
Problem with disabled select Hi all. I have this form: <select size="1" name="FRG_FNC"> <option value="">Select value</option> <option...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.