Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Old 07-03-2006, 10:13 AM   #1 (permalink)
Contributing Member
 
Join Date: 10-13-03
Location: Finland
Posts: 320
iTrader: 0 / 0%
Latest Blog:
None

Cibok is just really niceCibok is just really niceCibok is just really niceCibok is just really niceCibok is just really niceCibok is just really niceCibok is just really niceCibok is just really niceCibok is just really niceCibok is just really nice
Send a message via ICQ to Cibok Send a message via AIM to Cibok Send a message via MSN to Cibok Send a message via Yahoo to Cibok
Disabling Double-Submitting On Forms

Hi,

I have several forms all over my website. Currently when I double-click the submit button, the form gets sent out twice. I'd like to prevent this from happening. I guess I need some sort of javascript for this, but I have no knowledge of javascript!

I tried a few premade ones, but they didn't work on all browsers (and some didn't work at all). So if you have something that I could just put on my site's header.php file that would solve the problem, then that would be perfect!

I can also just ofcourse edit all the forms myself, but that would take some more time.

Thanks!
__________________
Stupid Video Clips - Just a collection of stupid videos!
The Hitchhiker's Guide To The Galaxy - Fan Site
Cibok is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-06-2006, 02:35 AM   #2 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,468
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to beholdLazyJim is a splendid one to behold
Send a message via MSN to LazyJim
As this is a code question why not try the coding forum?
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 07-06-2006, 03:16 AM   #3 (permalink)
Contributing Member
 
helloworld's Avatar
 
Join Date: 06-29-06
Posts: 70
iTrader: 0 / 0%
Latest Blog:
None

helloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebodyhelloworld is liked by somebody
The best solution is to place the forms on a seperate page from the scripts.

Alot of scripts use: action=\"$PHP_SELF\", or for html: action="<?PHP_SELF?>"

Instead it's wise to use: action=\"location-to-scipt\" or
for html: action="location-to-scipt"


----------------------------------------------------------------------------------------
could use java



<script language:"javaScript">
function hideMybutton(){
var myForm = document.formName;
myForm.mySubmitbutton.style.visibility="hidden";
alert("The Form has been sent please wait");
}
</script>

add this: onClick="hideMybutton();" name="mySubmitbutton" to your button


ie:
<input type="button" value=" submit " onClick="hideMybutton();" name="mySubmitbutton">

Last edited by helloworld; 07-06-2006 at 03:34 AM..
helloworld is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
submitting to directory / same IP juststones SEO Forum 6 05-24-2007 05:27 PM
Google Disabling Adsense June 1st peter_d Google Forum 10 05-21-2007 02:08 PM
Google: Disabling the Politically Incorrect Ferre Google Forum 4 02-21-2007 08:50 AM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 05:47 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.