|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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. |
|
#4
|
|||
|
|||
|
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' "); |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Ill-logical behaviour of javascript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|