473,609 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

populating text box based on drop down list

48 New Member
I have a text box called pro and a drop down list called scac. I am wanting to format the text box based on what is selected in the drop down. ex. pro is 1234564 and i want to format is based on the scac ABC to make it 1236-4564. I want to be able to add the format to be able to match how the scac code is formatted, whether it is separated by a space or a "-". If there is any information that i can give to help, then please let me know.
Sep 17 '15 #1
3 1506
Luk3r
300 Contributor
Do you have a current bit of code that you're trying and it isn't working? That'd be the first step.
Sep 17 '15 #2
lillyehrhart
48 New Member
i do not have any code for that because i am not really sure where to start.
here is my textbox for the pro
Expand|Select|Wrap|Line Numbers
  1. <div style="min-height: 5px;"></div>
  2.                     <div style="padding-top: 3px; padding-bottom: 3px;">
  3.                         <div style="float: left; width: 75px; text-align: right; padding-right: 5px;">Pro: </div>
  4.                         <div style="float: left; text-align: left;">
  5.                             <asp:TextBox ID="tbProNumber" Width="115px" runat="server"></asp:TextBox>
  6.                             &nbsp;OR
  7.                         </div>
  8.                         <div style="clear: both"></div>
  9.                     </div>
here is the code for the drop down list
Expand|Select|Wrap|Line Numbers
  1.   <div style="padding-top: 3px; padding-bottom: 10px;">
  2.                         <div style="height: 18px">Carrier/SCAC </div>
  3.                         <div style="text-align: center; width: 100%">
  4.  
  5.                             <asp:DropDownList runat="server" EnableViewState="true" ID="ddlScacs" AutoPostBack="True"></asp:DropDownList>
  6.                             <div style="min-height: 4px;"></div>
  7.                             <asp:DropDownList runat="server" EnableViewState="true" ID="ddlCarriers" Width="130px" AutoPostBack="True"></asp:DropDownList>
  8.                         </div>
right now when you select something from the dropdown list, nothing changes in the pro text box
Expand|Select|Wrap|Line Numbers
  1.  Protected Sub ddlCarriers_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlCarriers.SelectedIndexChanged
  2.         ddlScacs.SelectedIndex = ddlCarriers.SelectedIndex
  3.     End Sub
  4.  
  5.     Protected Sub ddlScacs_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlScacs.SelectedIndexChanged
  6.         ddlCarriers.SelectedIndex = ddlScacs.SelectedIndex
  7.     End Sub
I do not have anything in the textchanged for the pro number yet.

i think that i would just populate the text box based on the selection from the carrier dropdown list and the scac dropdown list. every carrier has a different format for the pro. so i need to format the pro text box based on the selection. Some of them have the format of "123 1234 0" and others 12-123-456", they are different. please help!
Sep 23 '15 #3
madankarmukta
308 Contributor
@lillyehrhart ,

May be this is the one you are looking for -

Adding a format to the TextBox in asp.net [closed]

Please let me know for any issues or clarifications.

Best Regards.
Sep 25 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2468
by: msnews.microsoft.com | last post by:
I'd like to hear your thoughts on best methods for populating drop down list controls. I have states and countries drop down lists that don't change often, so naturally I "hard code" them in the aspx page. But the problem is these tend to really slow the development -- it takes up to 15 seconds for the page to come up in VS.NET design environment, so I'm thinking about taking these out and populating the controls dynamically using the...
13
5239
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data structures? Thanks for any hints, Leszek Taratuta
2
12608
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will select any skill in 1st drop down list then i'll select % of this skill in the 2nd list box , based on the percentage i've selected in the 2nd list box it has to display 2 sets of drop down list boxes at run time one for selecting skill and
1
1983
by: vinitfichadia | last post by:
Hello Pals, In VB.Net, I am having textbox which has autocomplete source of 100 strings, i want feature in which, the list of 100 strings drops down once the specific textbox gets the focus. Thanks for your consideration -Vinit Fichadia
1
4538
by: TechnoAtif | last post by:
HI.. I am looking for php code that will enable me to hide/show a text box based on the users previous drop down list response. If javascript comes into use for it, its a welcome solution (1) I want the "additional" text box to ONLY display if the user answers the drop down list with "yes" (2) If the user answers "no" to the previous drop down list I don't want the "additional" text box displayed (3) When the form is originally...
1
6327
by: boss1 | last post by:
hello everyone, I am having a problem with populating second a drop down list depending on selected value of first drop down list. I have been searching the net for the last couple of days i found php with mysql and but couldn't find anything for oracle + php. in php using sql pulling from and oracle db. Can anyone help or tell me . Thanks in advance
3
5878
by: jcassan | last post by:
Hello folks. I am new to these forums and have something, which has been stumping me for little while. I am using pspell to spellcheck a scrolling textbox (textarea) containing user input. I analyze each word and rebuild the text string as a combination of correct text (not misspelled) and a drop down list offering suggestions in place of any misspelled words. Pretty common stuff using pspell. I display the new string so that the user...
7
5136
by: nlal | last post by:
Hi i m trying to create two drop down list boxes where the second drop downl list box is populated based on the selection of the first one.I have searching the net for days and even the scripts i downloaded don't seem to be working..Can anyone help me plz.....Its urgent...I have deadline approaching....
8
1353
by: rose merry | last post by:
I'm trying hard with displaying details from a selected option in a drop down list for my project. I have a two dropdown list which is populated from a MYSQLi query. I want the user to select an option from two drop down list and the values associated pulled from the database table and displayed to the user. The dynamically populated drop down list is for "destination" of routes(Table Name) and "arrival"(from routea table) when a user...
0
8136
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
8086
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
8574
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8551
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...
0
8407
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
7017
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5521
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
4027
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
1679
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.