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

SELECT+TEXT INPUT

RHO
Hi'
I've got a probably easy question but haven't figured out what the answer is

In a form I've got an input text field named 'myText' and a SELECT field
mySelect. Outside the form I've defined an array like
myArray=new Array('Item1','Item2','Item3');
Now I want to change the value of the myText field in response to a change
in the mySelect field. I've made a function
One variant (among lots) is this one
Function myChangeFunc(id){
myForm.myText.value=myArray[id];
}

Another one is
eval("myForm.myText.value") = myArray[id];

Nothing seems to works. Please advise me !

Cheers,

RHO
Jul 20 '05 #1
1 3270
RHO wrote:
Hi'
I've got a probably easy question but haven't figured out what the
answer is

In a form I've got an input text field named 'myText' and a SELECT
field mySelect. Outside the form I've defined an array like
myArray=new Array('Item1','Item2','Item3');
Now I want to change the value of the myText field in response to a
change in the mySelect field. I've made a function
One variant (among lots) is this one
Function myChangeFunc(id){
myForm.myText.value=myArray[id];
}
You should use function instead of Function.
Another one is
eval("myForm.myText.value") = myArray[id];
You can't use the result of a function on the left side of an assignment.
Nothing seems to works. Please advise me !

Cheers,

RHO


You didn't tell us how you get the value of id.
I guess that's where the error is.

--

Rollo Tomasi
Jul 20 '05 #2

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

Similar topics

0
by: Spare Change | last post by:
I've set up a form with a TextBox and a ListBox ( You can see all code here: http://home.earthlink.net/~jabailo/Windopes%20SupaText/ ) Right now, if you double-click and select text in the...
1
by: Able | last post by:
Dear friends It exist a number of various apps displaying multiple selected text. Normally every search function displays all hits as selected text in some sort of text-control. Do somebody know...
2
by: RobKinney1 | last post by:
Hello and thank you for reading this post. I have a RichTextBox. I need to select text inside for a search feature. Easy enough... right? Well apparently from the .NET help and everything from...
6
by: Michi | last post by:
Hallo, of course, this doesn't work: document.getElementById('ID').style.-moz-user-select = 'text'; - but i hope it shows my problem... Is it possible to set this css option by javascript and...
0
by: Concolor | last post by:
The .NET Windows Forms version of a Textbox object has a Select method, but there is not one for the Web Forms version. Is there anyway to select text inside of a Web Forms Textbox object? Also,...
3
by: mudassir368 | last post by:
How to select text in textbox control, if it is focussed using javascript
5
by: mwpclark | last post by:
I have javascript code which passes select input form field values in Firefox and Opera but it does not seem to work in IE7. This form runs a search, and the search results page has the same form...
5
by: AlmightyJu | last post by:
Hi all, I just joined because I've found loads of help on this site but I cant find an answer to this. I have a form that i loads data in from a database and stores them in various controls...
7
by: chaitanya83 | last post by:
How to select text which is in multiple lines on clicking more than twice? I have scenario like this: eg:-6118051 Non-Receipt Per web, delivery incomplete. Request trace and driver followup...
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
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?
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:
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
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...
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...

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.