/    Sign up×
Community /Pin to ProfileBookmark

Displaying text when a user clicks Submit in a form

Hey everybody,

I have a Image Hosting site

I was just wondering, would there be a way with JavaScript to make it so when a user click the Submit button in the upload form a bit of text displays saying something like, “Thank you, Please be patient while your image is uploaded”

I’ve looked around various places on the internet, and cannot find a code, but i have seen this type of thing on other websites.

Thanks in advanced,
dtcapener

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@bradmasterxJan 01.2008 — This might be what you are looking for:
[code=html]
<form action="" method="post" name="upload" id="upload">
<p>
<input type="file" name="file" id="file">
</p>
<p>
<input type="button" name="do" id="do" value="UPLOAD" onclick="setTimeout('document.upload.submit()', 2000); document.getElementById('txtFeedback').innerHTML = 'Thank you, Please be patient while your image is uploaded.';">
<div id="txtFeedback"></div></p>
</form>

[/code]
Copy linkTweet thisAlerts:
@dtcapenerauthorJan 01.2008 — thank you so much, it works perfectly ?

but i was wondering i want the submit button to disable itself when you click it too,

i have this peice of code for that:

[code=html]<input type="submit" onclick="this.disabled=true;">[/code]

but i do no know how to integrate it with the code bradmasterx gave me which is:

[code=html]<form action="" method="post" name="upload" id="upload">
<p>
<input type="file" name="file" id="file">
</p>
<p>
<input type="button" name="do" id="do" value="UPLOAD" onclick="setTimeout('document.upload.submit()', 2000); document.getElementById('txtFeedback').innerHTML = 'Thank you, Please be patient while your image is uploaded.';">
<div id="txtFeedback"></div></p>
</form>
[/code]


Could somebody please help me out with this please?

I've tried a few things but cannot get it to work ?

Thanks,

dtcapener
Copy linkTweet thisAlerts:
@magentaplacentaJan 02.2008 — Just add it to the end of the onlick:

<form action="" method="post" name="upload" id="upload">

<p><input type="file" name="file" id="file"></p>

<p><input type="button" name="do" id="do" value="UPLOAD" onclick="setTimeout('document.upload.submit()', 2000); document.getElementById('txtFeedback').innerHTML = 'Thank you, Please be patient while your image is uploaded.'; [b]this.disabled=true;[/b]">

<div id="txtFeedback"></div></p>

</form>
×

Success!

Help @dtcapener 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 6.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...