473,385 Members | 1,872 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,385 software developers and data experts.

how to display in new text field when i add option from drop down list?

how to display in new text field when i add option from drop down list?
Dec 23 '10 #1
2 2166
how to display word in new text field when i add option from drop down list?
Dec 23 '10 #2
AutumnsDecay
170 100+
I'm not quite sure I understand what you're meaning, but I'll take a stab at it.

If you have:

Expand|Select|Wrap|Line Numbers
  1. <select name="selectBox">   <option>1</option>   <option>2</otpion>   </select>
  2.  
You could simply add an 'onchange' javascript function to the element.

Expand|Select|Wrap|Line Numbers
  1. <select name="selectBox" onchange="myFunction();">   <option>1</option>   <option>2</otpion>   </select>
  2.  
The the <head> of your page you could put:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <script type="text/javascript">
  3.  
  4. myFunction(){
  5.     document.getElementById('textfield').html = "New text!";
  6. }
  7.  
  8. </script>
  9.  
So what's happening is that you set a javascript function do something to an element with the id of 'textfield'. What you told it to do is change the html (text) of that element.

When you make a selection with your SELECT element, the 'onchange' event is fired and does your javascript function.

I hope this is clear enough.
Dec 24 '10 #3

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

Similar topics

2
by: Serge Myrand | last post by:
Hi, I cannot get the selected option to be POSTed (it does not appear in the QueryString when using GET neither) I construct the drop down list from an array, I select an element in the list,...
0
by: owyn | last post by:
Think of a Drop Down List in a template column in a data grid in the Edit Template. In the Item template there is a label whose: text = '<%# DataBinder.Eval(Container.DataItem, "FieldName")%>' The...
5
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1);...
1
by: Hardy Wang | last post by:
Hi all, I have a drop down list with some items, and one of the item contains very long text. I want to limit the width of the drop down itself, but when I click down arrow to pull down the...
3
by: cpptutor2000 | last post by:
Could some PHP guru please help me? I am have a drop down list, whose options are read in dynamically from a table in a MySQL database. one of the items being read in is an URL. I am unable to...
0
by: Derty | last post by:
Have an issue with a simple drop down list that I need to filter results of a database table and page display. I can get the drop down list to populate correctly but can't make the page databound...
1
by: jacbyrd | last post by:
I have created a user control that is a drop down list that pulls from my database. I then drop that control into a detailsview control on an insert item template. When I run the insert command,...
0
by: JenniferG | last post by:
I've worked with ASP.NET but don't know much about ASP at all. I have the following code. I would like to get a person' birthday and phone number text box populated when the person's name is selected...
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)...
2
by: indhuma | last post by:
Hi, I'm using the following code to show the category = thoughts. I have three categories, when i select thoughts only it has to show the thoughts category. If i select other category it has to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
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,...
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...

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.