udens Posted April 25, 2008 Report Posted April 25, 2008 Visur iet uz ie7 neiet, ar js uzgjenereeju radio pogu pieshkjiru name utt bet ieslectet nevar, kaads mosh zin kaa to var apiet?
udens Posted April 25, 2008 Author Report Posted April 25, 2008 (edited) Parādi kodiņu. var newRadio=document.createElement('input'); newRadio.setAttribute('type','radio'); newRadio.setAttribute('style','padding-left:3px;'); newRadio.setAttribute('value',a); newRadio.setAttribute('name','correct_'+id); newLi.appendChild(newRadio); nu es taisu aptauju kur ar js tu nospied + un sem jautaajuma pieevienojas inputi kur var savadiit atbildes un katram iputam galaa ir radio visiem radio ir vienaads name lai var noraadiit tikai vienu pareizu atbildi. Edited April 25, 2008 by udens
indoom Posted April 25, 2008 Report Posted April 25, 2008 (edited) Uz IE elementi, kam grib pēc tam name nolasīt jātaisa citādāk document.createElement('<input name="name">'); crossbrowseru skripts varētu būt šāds function createNamedElement(type,name){ var element=null; try{ element=document.createElement('<'+type+' name="'+name+'">'); }catch(e){ element=document.createElement(type); element.name=name; } return element; } var el = createNamedElement('input','correct_'+id); el.type = 'radio'; Edited April 25, 2008 by indoom
Recommended Posts