Click here to Skip to main content
15,899,754 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: OK, so I have this website... Pin
Sebastián Benítez26-Dec-03 17:07
Sebastián Benítez26-Dec-03 17:07 
GeneralRe: OK, so I have this website... Pin
Roger Wright28-Dec-03 5:45
professionalRoger Wright28-Dec-03 5:45 
GeneralRe: OK, so I have this website... Pin
nssone28-Dec-03 6:08
nssone28-Dec-03 6:08 
GeneralRe: OK, so I have this website... Pin
Roger Wright28-Dec-03 6:22
professionalRoger Wright28-Dec-03 6:22 
GeneralRe: OK, so I have this website... Pin
nssone28-Dec-03 16:42
nssone28-Dec-03 16:42 
GeneralRe: OK, so I have this website... Pin
perlmunger5-Jan-04 12:58
perlmunger5-Jan-04 12:58 
GeneralIexplorer and 8 bit images Pin
georgiek5025-Dec-03 21:17
georgiek5025-Dec-03 21:17 
Questionhow to "setAttribute" for an event Pin
webProgrammer25-Dec-03 15:09
webProgrammer25-Dec-03 15:09 
does anyone know how to use the "setAttribute" method in javascript to add an event to an element?

for some reason it seems that it's actually adding the event, however the event never get's fired.

here is a copy of the code I'm using:

<br />
<script><br />
var newField = document.createElement("INPUT");<br />
newField.type = 'file';<br />
newField.id = 1;<br />
newField.setAttribute("onChange","alert('hi')");<br />
	<br />
document.getElementById(fields-1).insertAdjacentElement("afterEnd",newField)<br />
</script><br />


when I use the "view partial source" add-in for "ie" it shows that the element was added with the attribute, however, when I change the content of the field the event does not get fired. - as opposed to when I set that same attribute in plain HTML... - like so <input type="file" onchange="alert('hi');" id="1">

all help is appreciated.

thanks in advance,

- webProgrammer
AnswerRe: how to &quot;setAttribute&quot; for an event Pin
Heath Stewart28-Dec-03 4:21
protectorHeath Stewart28-Dec-03 4:21 
GeneralRe: how to &quot;setAttribute&quot; for an event Pin
webProgrammer28-Dec-03 6:18
webProgrammer28-Dec-03 6:18 
GeneralRe: how to &quot;setAttribute&quot; for an event Pin
Heath Stewart28-Dec-03 6:32
protectorHeath Stewart28-Dec-03 6:32 
GeneralRe: how to &quot;setAttribute&quot; for an event Pin
webProgrammer28-Dec-03 15:32
webProgrammer28-Dec-03 15:32 
GeneralRe: how to &quot;setAttribute&quot; for an event Pin
Heath Stewart28-Dec-03 18:03
protectorHeath Stewart28-Dec-03 18:03 
GeneralRe: how to "setAttribute" for an event Pin
Richard Deeming9-Jan-04 7:08
mveRichard Deeming9-Jan-04 7:08 
Generalfixed background in table Pin
Brakanjan25-Dec-03 12:36
Brakanjan25-Dec-03 12:36 
GeneralRe: fixed background in table Pin
l a u r e n25-Dec-03 13:49
l a u r e n25-Dec-03 13:49 
GeneralRe: fixed background in table Pin
Brakanjan26-Dec-03 9:31
Brakanjan26-Dec-03 9:31 
GeneralRe: fixed background in table Pin
l a u r e n26-Dec-03 9:53
l a u r e n26-Dec-03 9:53 
GeneralWeb Site Design Pin
vivek_mastishk24-Dec-03 20:19
vivek_mastishk24-Dec-03 20:19 
GeneralRe: Web Site Design Pin
Sarvesvara (BVKS) Dasa25-Dec-03 8:24
Sarvesvara (BVKS) Dasa25-Dec-03 8:24 
GeneralRe: Web Site Design Pin
alex.barylski25-Dec-03 8:35
alex.barylski25-Dec-03 8:35 
GeneralRe: Web Site Design Pin
brianwelsch26-Dec-03 7:52
brianwelsch26-Dec-03 7:52 
GeneralRe: Web Site Design Pin
theJazzyBrain29-Dec-03 2:05
theJazzyBrain29-Dec-03 2:05 
QuestionWhat font is this?? Pin
Sarvesvara (BVKS) Dasa23-Dec-03 2:48
Sarvesvara (BVKS) Dasa23-Dec-03 2:48 
AnswerRe: What font is this?? Pin
Ian Darling23-Dec-03 3:22
Ian Darling23-Dec-03 3:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.