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

IE not allowing adding diff proprties to an element, Y?

130 100+
hello all,

i have a form with 6 elemnt:

Expand|Select|Wrap|Line Numbers
  1. <label><input type="radio" name="name_b" value="120x60" checked="checked"/>120x60</label><!-- #1 -->
  2. <input type="radio" name="name_b" value="468x60" />468x60</label><!--#2-->
  3. <input type="text" size="6" id="wx" name="wx" value="200" checked="checked"/><!--#3 notice the checked="checked" i add -->
  4. <input type="text" size="6" id="wy" name="wy" value="200" checked="checked"/><!--#4 -->
  5. <input type="text" size="40" id="path" name="path" value="i need this value" checked="checked" /><!--#5-->
  6. <input type="submit" value="go" /><!--#6-->
what i want to do (and manage to do it with FF but not with IE) is to get the elements that are sepose to b send to the server, here is the function i use

Expand|Select|Wrap|Line Numbers
  1.    x=document.forms['myform_name'];
  2.    f="elements i need from my form\n";
  3.    for(i=0; i<(x.elements.length-1); i++){//-1 cuz i dont need the submit button
  4.       if(x.elements[i].checked){//thats y i add the checked to the elements
  5.          f+=x.elements[i].value;
  6.          f+="\n";
  7.       }
  8.    alert(f);
  9.    }
is there a short way for IE as well ?
Apr 10 '08 #1
3 1150
pronerd
392 Expert 256MB
I do not think it is valid to have the checked attribute any type of input fields other than checkboxes. That is probably what the "if(x.elements[i].checked)" if test is failing and causing that code to not be executed.
Apr 10 '08 #2
Amzul
130 100+
I do not think it is valid to have the checked attribute any type of input fields other than checkboxes. That is probably what the "if(x.elements[i].checked)" if test is failing and causing that code to not be executed.
i know its not valid, just wonder why IE cant be more flexible, or maybe there is somthing similler i can use to di the same.

i want the form data without submiting it to the server, keep it on the clint side.
just wonder what if it was a realy long form with alot of elements....
Apr 10 '08 #3
acoder
16,027 Expert Mod 8TB
Use, for example, the class attribute instead. Then use className to check the class of the form elements.
Apr 11 '08 #4

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

Similar topics

10
by: Sunny K | last post by:
Hi guys, I have a field in my DB called EventDate as a DateTime field, therefore it holds both the date and time together like this: '2004-10-14 08:42:57.000'. I need to add together all the...
8
by: MENTAT | last post by:
Hi Guys, Newbie question here. Part of my xml looks like this. <node> <description/> <config/> <log/> <transition/> <node>
2
by: RobG | last post by:
I am trying to dynamically add an onclick to an element, however I just can't get the syntax right. consider the following function: function doClick (evt,x) { // do things with evt and x } ...
9
by: Ching-Lung | last post by:
Hi all, I try to create a tool to check the delta (diff) of 2 binaries and create the delta binary. I use binary formatter (serialization) to create the delta binary. It works fine but the...
6
by: Igor Shevchenko | last post by:
Hi! Suppose I have "pg_dump -s" of two pg installs, one is "dev", another is "production". Their schemas don't differ too much, and I want to get a "diff -u"-like schema diff so I can quickly...
4
by: glebur | last post by:
Hi, I'm trying to create a web service client in C# but I get stuck at one of the first steps. When adding a Web reference to the Visual Studio project; I get this error (this is a translation,...
4
by: Andreas Kasparek | last post by:
Hola! I'm preparing my master thesis about a XML Merge Tool implementation and was wondering if there is any open standard for XML diff regarding topics like: - is a diff result computed on...
1
by: KPS | last post by:
I'm attempting to create a simple treeview-like behavior in JavaScript. The desired behavior happens in IE but I cannot get the same to happen in FireFox. The primary thing I want to accomplish...
4
by: ramasubramanian.rahul | last post by:
if we have a declaration int arr = { 1,2,3,4,5}; int *ptr; what is the diff betn ptr = &a and ptr = a ; when i do ptr = &a ; or ptr = a ; and then ptr += 2 ; then *ptr points to 3 in both...
6
by: Aaron Gray | last post by:
Hi, I am working on an HTML WYSISYG Wiki and need to display a diff page like WikiPedia does if two people edit a file at the same time to give the second user the diff. Basically with additions...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.