JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old May 16th, 2006, 09:12 AM
ravs ravs is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2006
Location: gurgaon, haryana, india
Posts: 60 ravs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 44 m 29 sec
Reputation Power: 3
Send a message via Yahoo to ravs
Cool Ill-logical behaviour of javascript

hello friends
i found a problem
i am trying to draw a dynamic javascript javascript grid with a radio button inside the first col.and i wanted to have diffrent id of radio but with same names. but it didnt happned.

what i did is this

loop starts[

var oRdo= document.createElement("input");
oRdo.id="some dynamic ID";// this will change eaxch time
oRdo.name="rav";
oRdo.type="radio";
oRdo.setAttribute("userID","some dynamic user id")// look this is a user defined attribute

]loop ends

i checked the rendered code it is making all attributes accept name;

then i found another way

var oRdo=document.createElement("<input id='"+some_dynamic_ID+"' name='rav' type='radio'>")

this time it worked.

i am unable to identify why this happned.

can any one suggest

Reply With Quote
  #2  
Old May 16th, 2006, 11:29 AM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 541 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 2 h 15 m 6 sec
Reputation Power: 3
id and name

The "id" and "name" attributes are somewhat interchangeable. I would not name them differently in the same element. You could give all the radios the same "class" value, but each should be a matched pair. eg.
<radio id=rad1 name=rad1
<radio id=rad2 name=rad2
<radio id=rad3 name=rad3
I WOULD NOT DO
<radio id=rad1 name=rad
<radio id=rad2 name=rad
<radio id=rad3 name=rad
even if you are able to get this so it seems to be working, you are asking for problems doing it this way.

Reply With Quote
  #3  
Old May 16th, 2006, 02:37 PM
Kravvitz Kravvitz is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Location: USA
Posts: 134 Kravvitz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 38 m 30 sec
Reputation Power: 4
I think that's a bug in IE.

Don't forget to test in good browsers like Firefox and Opera.

Reply With Quote
  #4  
Old May 16th, 2006, 09:55 PM
ravs ravs is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2006
Location: gurgaon, haryana, india
Posts: 60 ravs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 44 m 29 sec
Reputation Power: 3
Send a message via Yahoo to ravs
but my requitment is little diffrent.
but i resolved the problem. now it is working prefectly.

var oElement= document.createElement("<input type='text' id='abc' name='rdo' creator='RAVS' ");

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Ill-logical behaviour of javascript


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway