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

Why is my Form DOM type attribute returning this?

Samishii23
246 100+
I'm making a confirm dialog box to ask user upon form submission if this is what he wants to enter in a database. So since all my form names are straight forward about whats being entered. I have this test function.

Expand|Select|Wrap|Line Numbers
  1. function testing() {
  2.     var f = document.formEquipment;
  3.     var l = f.elements.length;
  4.     var txt;
  5.  
  6.     for ( i=0; i<l; i++ ) {
  7.         if ( f.elements[i].type != "radio" )
  8.         if ( f.elements[i].type != "" )
  9.         if ( f.elements[i].name != "button" )
  10.         if ( f.elements[i].type != "reset" )
  11.             txt += f.elements[i].type +"|"+ f.elements[i].name.cap() +": "+ f.elements[i].value +"\n";
  12.         }
  13.     alert(txt);
  14.     }
(.cap() is a string prototype of mine)
Heres my current output:
undefinedsubmit|:
hidden|Sectionid: 1
hidden|Formtype: add
text|Name:
text|Purchasedate:
text|Price:
select-one|Type:
text|Serial:
text|Brand:
text|Usagevalue:
text|Notes:
The top item is a <button> tag, that even if I put a name attribute to it won't stop giving me that undefinedsubmit crap.
Does anyone know why this does this?
Feb 21 '11 #1
1 1358
johny10151981
1,059 1GB
Expand|Select|Wrap|Line Numbers
  1. if ( f.elements[i].type != "radio" )
  2.         if ( f.elements[i].type != "" )
  3.         if ( f.elements[i].name != "button" )
  4.         if ( f.elements[i].type != "reset" )
Write this as

Expand|Select|Wrap|Line Numbers
  1. if ( f.elements[i].type != "radio" && f.elements[i].type != "" && f.elements[i].name != "button" && f.elements[i].type != "reset" )
Feb 22 '11 #2

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

Similar topics

1
by: Edward | last post by:
Access 97 SR 2 Front End SQL Server 7.00.1063 Back End When I attempt to relink the tables in my Access app. I am suddenly getting this weird error message = "ODBC--Call Failed", followed by...
1
by: Brunswick | last post by:
I am in the process of defining a protocol that my company will use to communicate with its customers. At the moment I'm scratching my head about one issue. Should I use type-specific elements to...
2
by: belgie | last post by:
Whereas in Asp I could submit my form contents to any other Asp page, it appears that in Asp.NET the primary Asp form will only submit to itself. I have tried changing the Action attribute in the...
1
by: Bonavox | last post by:
Hi! FYI: I had some trouble with the type attribute in one of my providers in web.config. I was writing it by hand, and got this error all the time: Required attribute 'type' not found....
1
by: David Lozzi | last post by:
Hello, My webservice is receiving the following error. It runs fine on my local development machine,but when moved to production it errors. I found one KB about this error but it was in regards...
4
by: wwwmike | last post by:
How can I overwrite the <FORM action=attribute? I can add new attributes with Dim xx As System.Web.UI.HtmlControls.HtmlForm xx = Page.FindControl("form1") xx.Attributes.Add("something",...
4
by: jackchang1 | last post by:
I just went across Douglas Crockford's website, and in this page, he mentions that the type/language attribute is not needed, since it is the server that determines the MIME type. But according to...
0
by: vinodpatel | last post by:
HI I am loading some files using bulk insert from store procedure. Iand I am also using sp_OA... to move files to other folder Some time while Executing this store procedure I am getting ERROR...
1
by: Achim Domma | last post by:
Hi, in my data contract I have a member like this: public List<BaseClassItems { get { ... } } The property is serialized as a list of <BaseClasstags with an i:type attribute. It would be...
23
by: Andreas Prilop | last post by:
Is there any *practical* use of writing, say, <a href="book.pdf" type="application/pdf"> with a TYPE attribute? -- Top-posting. What's the most irritating thing on Usenet?
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
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
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
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.