473,413 Members | 2,043 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,413 software developers and data experts.

populating text box based on drop down list

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 1500
Luk3r
300 256MB
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
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 256MB
@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
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...
13
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...
2
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...
1
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. ...
1
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)...
1
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...
3
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...
7
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...
8
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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,...
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.