473,651 Members | 2,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need a dropdown list that holds the value

Hey Everyone,

I was hoping someone could help me here. I need a way to have a drop
down that when selected it can keep a value and display it below here
is an example.
A drop down list of different shipping methods.

Ground
3day
2day

then a price on the back end associated with each of them
ground = 8
3day = 10
2day = 14

then finally a box under it to display what was chosen so if Ground
was chosen the box below it will show 8

Can anyone help me with this. I can attach what Ive started but as you
can see have now clue what im doing. and its prob all wrong but at
least you might get a understanding.
<select name="selectbox " value="shipping " size="1">
<option name="ground" value="8.50" >Ground - $8.50</
option>
<option name="3day" value="10.50" >3-Day - $10.50</option>
<option name="2day" value="14.50">2-Day - $14.50</option>
<option name="overnight " value="24.00">O vernight - $24.00</option>
</select><br>

<!-- Display Below -->
<input type="text" value="" name="shipping" Has been Selected

Thank you in Advanced
Jun 27 '08 #1
3 1744
Hey so THank you so much for the script however I was hoping I would
be able to incorperate it into my original script but seems to not be
working. Here is the script Im sure there isnt much left todo but
still if soemone can help.

I just need when they select the shipping methiod it gets added to the
total amount and also to the downpayment as (+ downpayment)

THank you

Yoni

<body>
<form name="converter ">
<input type="text" value="0.00" name="price"Pri ce of Item
<br>

<select name="shippingO ptions" onchange="this. form.shippingPr ice.value
= this.options[this.selectedIn dex].value; ">
<option value="8.50">Gr ound - $8.50</option>
<option value="10.50">3-Day - $10.50</option>
<option value="14.50">2-Day - $14.50</option>
<option value="24.00">O vernight - $24.00</option></select>
<input type="text" value="" name="shippingP rice">

<br>
<br><br>
<input type="button" value="Convert" onclick="javasc ript:calc()">
<input type="reset" value="reset" onclick="javasc ript:calc()">
<br><br>
<input type="text" value="" name="downpayme nt"Down Payment
<br>
<input type="text" value="" name="payment2" Payment 2
<br>
<input type="text" value="" name="payment3" Payment 3
<br>
<input type="text" value="" name="payment4" Payment 4
<br>
<input type="text" value="" name="payment5" Payment 5
<br>
<br>
<input type="text" value="" name="total"Tot al Amount Paid

</form>

<script language="javas cript">

//calculate function
function calc(){

//variables
var price = document.conver ter.price.value
var downpaymentdisp lay = Math.round(pric e * .60)
var payment2display = Math.round(pric e * .10)
var payment3display = Math.round(pric e * .10)
var payment4display = Math.round(pric e * .10)
var payment5display = Math.round(pric e * .10)

var totaldisplay = Math.round(down paymentdisplay + payment2display +
payment3display + payment4display + payment5display )

//write in text box
document.conver ter.downpayment .value=downpaym entdisplay
document.conver ter.payment2.va lue=payment2dis play
document.conver ter.payment3.va lue=payment3dis play
document.conver ter.payment4.va lue=payment4dis play
document.conver ter.payment5.va lue=payment5dis play
document.conver ter.total.value =totaldisplay

}
</script>
</body>
Jun 27 '08 #2
SAM
Yonih a écrit :
Hey Everyone,

I was hoping someone could help me here. I need a way to have a drop
down that when selected it can keep a value and display it below here
is an example.
A drop down list of different shipping methods.
<select name="selectbox " value="shipping " size="1"
onchange="var k=this.selected Index;
if(k==0) alert('choose another item');
else shipping.value= this.options[k].value;">

<option selected>Fee</otpion>
<option name="ground" value="8.50" >Ground - $8.50</option>
<option name="3day" value="10.50" >3-Day - $10.50</option>
<option name="2day" value="14.50">2-Day - $14.50</option>
<option name="overnight " value="24.00">O vernight - $24.00</option>
</select><br>

<!-- Display Below -->
<input type="text" value="" name="shipping" Has been Selected

--
sm
Jun 27 '08 #3
SAM
Yonih a écrit :
Hey so THank you so much for the script however I was hoping I would
be able to incorperate it into my original script but seems to not be
working. Here is the script Im sure there isnt much left todo but
still if soemone can help.

I just need when they select the shipping methiod it gets added to the
total amount and also to the downpayment as (+ downpayment)
<select name="shippingO ptions"
onchange="var k = this.selectedIn dex;
var fee = this.options[k].value;
shippingPrice.v alue = fee;
downpayment.val ue = +downpayment.va lue+fee;
calc(); ">

<form name="converter ">
<input type="text" value="0.00" name="price"Pri ce of Item
<br>

<select name="shippingO ptions" onchange="this. form.shippingPr ice.value
= this.options[this.selectedIn dex].value; ">
<option value="8.50">Gr ound - $8.50</option>
<option value="10.50">3-Day - $10.50</option>
<option value="14.50">2-Day - $14.50</option>
<option value="24.00">O vernight - $24.00</option></select>
<input type="text" value="" name="shippingP rice">

<br>
<br><br>
<input type="button" value="Convert" onclick="javasc ript:calc()">
<input type="reset" value="reset" onclick="javasc ript:calc()">
<br><br>
<input type="text" value="" name="downpayme nt"Down Payment
<br>
<input type="text" value="" name="payment2" Payment 2
<br>
<input type="text" value="" name="payment3" Payment 3
<br>
<input type="text" value="" name="payment4" Payment 4
<br>
<input type="text" value="" name="payment5" Payment 5
<br>
<br>
<input type="text" value="" name="total"Tot al Amount Paid

</form>

<script language="javas cript">

//calculate function
function calc(){

//variables
var price = document.conver ter.price.value
var downpaymentdisp lay = Math.round(pric e * .60)
var payment2display = Math.round(pric e * .10)
var payment3display = Math.round(pric e * .10)
var payment4display = Math.round(pric e * .10)
var payment5display = Math.round(pric e * .10)

var totaldisplay = Math.round(down paymentdisplay + payment2display +
payment3display + payment4display + payment5display )

//write in text box
document.conver ter.downpayment .value=downpaym entdisplay
document.conver ter.payment2.va lue=payment2dis play
document.conver ter.payment3.va lue=payment3dis play
document.conver ter.payment4.va lue=payment4dis play
document.conver ter.payment5.va lue=payment5dis play
document.conver ter.total.value =totaldisplay

}
</script>
</body>
Jun 27 '08 #4

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

Similar topics

1
8277
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two dropdown lists. If you change the selection of the left one (e.g. choose parentoption2), it should open up page2.htm in a popup window.
0
2588
by: Toonman | last post by:
I have a webpage with a <form> consisting of a large table grid of dropdown lists used to make changes in a database. Some of these dropdown lists have the same value. I'm trying to make it so that when a user mouses over one of the dropdown lists, that dropdown list, and all other dropdown lists having that same value are highlighted with a yellow background color. Then on a mouseout the yellow highlights go away. The goal is to it...
5
10819
by: Kris Rockwell | last post by:
Hello (again), I have gotten the dropdown list functionality to work through a few tricks (probably not the most efficient, but it works) but I am not sure how to set the default selected value. I have tried setting various values to represent the default value with little success. Essentially I am looking to have the first item in the list be the default selected item. I noticed in the properties for a dtat grid you could set a default...
4
4589
by: Paul | last post by:
I have a dropdown list box and a button on a web form, the autopost back is false for the dropdown list box and button. When the button is pushed the selection in the dropdownlist box is lost, just wondering what is wrong. Selected value is always 1 no matter what is selected in the dropdown list box. Private Sub btn_yes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_yes.Click Dim s_origidval As String
1
3294
by: JNariss | last post by:
Hello, I have created a form called frmS2P with the following: 1 listbox called List11 which holds the contents of a query created off my table called tblRequestActions. The fields which the listbox holds are Request_ID and MoveNumber. 1 text box called Date which is populated with the default value of =Date( ).
3
3520
by: er1 | last post by:
Hi all, I have created a double dropdown list. Based on the first list selection, second list populates (this works fine). I have a submit button, which when clicked should run a select query based on the values selected on both the dropdown lists. But this part is not working. It picks up right value for the first dropdown list and always takes the FIRST value of the second dropdown list. I am not sure how to make it use the selected value...
6
5847
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList ID="FldType_add" Runat="server" DataSource='< %#GetFieldType()%>' DataValueField="Type" DataTextField="Type" /> Oce the page is loaded all the values are added to the dropdown list. But when I thought of getting the selected value from the...
6
1964
by: Cralis | last post by:
Hi guys, Someone once said, 'You can do that with reflection'. I can't recall what it was I was trying to do at the time, but then he said, 'Any developer knows what reflection is...'. I kept quiet and smiled. What is reflection!? I have been reading it up, and all I can work out is that it has something to do with Late Binding, and the use of GetType and Type.
5
6178
by: plumba | last post by:
Hi all. I have two drop down menus, the first a list of Departments, the second a list of Sections. Each Department has a set of Setions, so the Sections dropdown contains complete list of all Sections for every Department. I would like to filter out the Section dropdown based on what Department the user selects, to stop the user selecting a Section not relevant to the chosen Department. The Section list is very long other wise I'd...
0
8347
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8694
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8457
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8571
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1905
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.