zaggs — 2010-08-19T07:11:30-04:00 — #1
I am trying to use SetAttribute to append a custom attribute to a form input. The code is below. Please help.
// Append the values
var uploader = document.getElementById("uploader");
The Form input:
<input id="uploader" type="file" auto="false" buttoncaption="Upload" multi="true" afterupload="link" maxsize="204800" />
zaggs — 2010-08-23T05:37:56-04:00 — #2
The JS code is triggered by an "onchange" event on a select menu.
tommichi — 2010-08-20T07:25:48-04:00 — #3
OK, can you provide just a little more background info:
- What action triggers the JS code?
- If the code executes as the page is opening, where is the script located? In the header, the body, or does it execute on window.onload?
If you could post a bit more source code, or at least a workable sample code, that would be helpful....
zaggs — 2010-08-20T06:51:47-04:00 — #4
Yes the attributes are not getting set. Not sure how I can check if the element in question is loaded yet?
tommichi — 2010-08-19T12:22:38-04:00 — #5
What exactly is the problem? the attributes are not set? It would be expected behavior if you run the script before the element in question is not yet loaded in the DOM