Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 613967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:03:39+00:00 2026-05-13T18:03:39+00:00

I wanted to convert my rate field by using one dropdownlist to convert it.

  • 0

I wanted to convert my rate field by using one dropdownlist to convert it. Eg, if the dropdownlist selected on japan, when the user select and change to malaysia the rate field will automatically change to malaysia rate from japan rate. Anyone?… Thanks…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:03:40+00:00Added an answer on May 13, 2026 at 6:03 pm

    Dropdown lists have two values – the text and the value. You have either bound your dropdown list to a set of items (probably in an IEnumerable like an array or List). So all you have to do is intercept the onchange event on the client side, grab the selected value of the dropdown, and place it into the label/textbox that shows the rate. Here is an example for you:

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
    
    <!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">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:DropDownList ID="DropDownList1" runat="server" onchange="javascript:PopulateRate(this.value);"></asp:DropDownList>
            <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
            <asp:TextBox ID="TextBox1" runat="server" onchange="javascript:SelectRate(this.value);" style="width: 100px;"></asp:TextBox>
        </div>
        </form>
    </body>
    
        <script language="javascript">
            function PopulateRate(value) {
                //debugger;
                document.getElementById('<% =Label1Name() %>').innerText = value;
            }
            function SelectRate(value) {
                var z = document.getElementById('<% =DropDownList1Name() %>');
                //method 1 to set dropdown selected item:
                z.value = value;
                //method 2 to set dropdown selected item::
                for (var i = 0; i < z.options.length; i++) {
                    if (z.options[i].value == value) {
                        z.options[i].selected = true;
                        return;
                    }
                } 
            }
        </script>
    
    </html>
    
    
    Partial Class _Default
    Inherits System.Web.UI.Page
    
    Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
        MyBase.OnLoad(e)
    
        Dim countryRates = New System.Collections.Generic.Dictionary(Of String, Decimal)
    
        countryRates.Add("Japan", 1.0)
        countryRates.Add("Malaysia", 1.5)
        countryRates.Add("Khazakstan", 1.75)
        countryRates.Add("Argentina", 2.0)
        countryRates.Add("Andorra", 2.5)
    
        DropDownList1.DataTextField = "Key"
        DropDownList1.DataValueField = "value"
        DropDownList1.DataSource = countryRates
        DropDownList1.DataBind()
    End Sub
    
    Protected Property Label1Name() As String
        Get
            Return Label1.UniqueID
        End Get
        Set(ByVal value As String)
    
        End Set
    End Property
    Protected Property DropDownList1Name() As String
        Get
            Return DropDownList1.UniqueID
        End Get
        Set(ByVal value As String)
    
        End Set
    End Property
    End Class
    

    From your description, this shows how to do what you want. I just want you to know that it hurt my head to have to do this sample in VB.Net 🙂 (so you will have to excuse my shoddy VB code, i usually do C#)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to generate one fix view using interface builder, but the size of
I wanted to convert DateTime data which will be pulled from source, to Date
Wanted to convert <br/> <br/> <br/> <br/> <br/> into <br/>
I wanted to write a function that would take an object and convert it
I wanted to convert array< Byte>^ to unsigned char*. I have tried to explain
I wanted to convert my existing stored procedures to LINQ-to-SQL Precompiled Dynamic SQL. Does
I wanted to convert some xml to a magazine like pdf document. A lot
i wanted to convert double to float in C, but wanted to preserve the
I'm wanted to convert some of my python code to C++ for speed but
I have following thing which i wanted to convert to int. char *ptr; //

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.