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

document.forms[0].elements[7].value won't work

Why doesn't this work - no errors, just no value when text is in textbox

var fn=document.forms[0].elements[7].value;

Thanks

Tom

Jul 23 '05 #1
3 2284
uNConVeNtiOnAL wrote:
Why doesn't this work - no errors, just no value when text is in textbox

var fn=document.forms[0].elements[7].value;


Define "doesnt work" and what browser?
Jul 23 '05 #2
uNConVeNtiOnAL wrote:
Why doesn't this work - no errors, just no value when text is in textbox

var fn=document.forms[0].elements[7].value;


<data> I do not have enough information to make a hypothesis. </data>
PointedEars
Jul 23 '05 #3
Lee
uNConVeNtiOnAL said:

Why doesn't this work - no errors, just no value when text is in textbox

var fn=document.forms[0].elements[7].value;


You haven't shown us enough information.
That line will work, if there is a value in a textbox
which is found at document.forms[0].elements[7].value

One common error would be to confuse elements[7] with
the seventh element. It is actually the eighth.

This demonstrates only one of many reason why it's
usually better to identify elements by name or id,
rather than number.

Jul 23 '05 #4

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

Similar topics

5
by: PhiSYS | last post by:
I want to know what's wrong with this code (I'm an amateur programmer). I'm trying to check if every field has a value or if checkboxes/radios have at least one item checked on each group (yes, you...
1
by: Helen | last post by:
Just found an interesting issue with ASP.NET web forms. If you give one of your form elements (a button in my case) an id of "submit" then any elements that use postback won't work. The form...
6
by: b. hotting | last post by:
Hi, I don't see why this won't work, it are 3 links, the last one (a get) does work, but the first 2 won't. i would like to use a post, through hidden input types any idea? thanks for your...
1
by: sheldongold | last post by:
Hi, I'm coding in PHP4 and MYSQL4 and there is a teensy bit of JS in there as well. I'm haveing trouble with my dropdown lists as when there is more than one on the page it just says 'error on...
2
by: memiller | last post by:
I have a hyperlink on an ASP page that calls another ASP page with the code shown below. This page allows (forces) a user to select a file to be uploaded, then should call a third ASP page that...
2
by: chris_j_adams | last post by:
Hi, I'm trying to pull some values out of a table in IE using Excel 97. This works: IeApp.Document.forms("form").elements("rates").Value This doesn't: nm = "rates"...
3
by: Igal | last post by:
hay. i'm working on some site, the code is pretty old, it has some form validation JS scripts. but seems like they work only in IE, won't work with FireFox. here's a example: <script...
6
by: Eric | last post by:
Hello, I have code similar to: if (beforeToday(document.forms.sStartDate.value)) that was broken when an include file had a form added to it. Since my form was no longer the 0th form, my...
1
by: swarfega | last post by:
Hi. I have a javascript which is designed to increase and decrease the text size of a particular div so that reaaders can feel more comfortable. However it works in IE, but not firefox or chrome. My...
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:
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
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
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,...

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.