/    Sign up×
Community /Pin to ProfileBookmark

chaning text/image when uploading a file from a forum

Hi,

I am new to Javascript and to this forum. I thought maybe someone could give some help. I have a very simple forum that uploads a file, and while the file is being uploaded, I want to display some text and display an animated gif (a type of progress indicator image).

I created a function that seems to do the trick, yet when I put the function call within the upload forum, it only changes the text, but not the image. If anyone can take a look at my code that would be great.

[CODE]
<html>
<head> <title> </title>
<script type=”text/javascript”>
function uploadChange(){
document.getElementById(‘uploadText’).innerHTML = ‘Uploading File’;
document.getElementById(‘loading’).src = ‘loadingAnimate.gif’;
}
</script>
</head>
<body>
<form enctype=’multipart/form-data’ action=’UploadAccept’ method=’POST’>
<input type=’hidden’ name=’MAX_FILE_SIZE’ value=’500000′ />
Choose a file to upload <input name=’uploadedfile’ type=’file’ />
<input type=’submit’ value=’Upload File’ onclick=”uploadChange()” />
</form>
</body>
<img src=”loadingSpace.gif” name=”loading” id=”loading” width=”48″ height=”48″ border=”1″>
<b id=’uploadText’> </b>
<input type=’button’ onclick=’uploadChange()’ value=’Change Text’/>
</html>

[/CODE]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@adamSplineauthorDec 09.2009 — I havn't got a response on this for a few weeks, so I thought I would just bump it up. If anyone can take a look at this, it would be most helpful... thanks.

-Adam
Copy linkTweet thisAlerts:
@JMRKERDec 09.2009 — See this for a ton of examples:

http://www.google.com/search?q=javascript+progress+bar :eek:
×

Success!

Help @adamSpline spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...