Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 11-06-2006, 10:12 PM Requesting a script
Extreme Talker

Posts: 217
Trades: 0
Hi, I would like to request a script to be made (or a link to a similar script). Im no good with javascript . Anyways I would like it so that when a user hits submit, it disables the submit button and brings up a alert. I also want it so that before the submit button is disabled it posts the form information to a php document.

Help is apreciated greatly
,Slick
Slick Nick is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-06-2006, 10:57 PM Re: Requesting a script
Extreme Talker

Posts: 246
Trades: 3
Having the form posted before the javascript code disabled the button, etc, might be able to be done using ajax (not sure). I also don't know whether that is absolutely necessary, as you may receive nearly the same results posting the form afterward. This is one of those "is the juice worth the squeeze?" questions, that only you can answer.

A button disable and alert example can be found here:
http://www.codetoad.com/javascript_validate_disable.asp
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
CouponGuy is offline
Reply With Quote
View Public Profile
 
Old 11-06-2006, 11:22 PM Re: Requesting a script
Extreme Talker

Posts: 217
Trades: 0
Well i want some sort of system inplace that makes it so that you cant post comments over and over really quicky (my site got spammed a ton last night >_> )

and yes i am talking about ajax, but from my understanding ajax is basicly just javascript
Slick Nick is offline
Reply With Quote
View Public Profile
 
Old 11-07-2006, 01:11 AM Re: Requesting a script
logic ali's Avatar
Super Talker

Posts: 104
Trades: 0
Quote:
Originally Posted by Slick Nick View Post
Well i want some sort of system inplace that makes it so that you cant post comments over and over really quicky (my site got spammed a ton last night >_> )

and yes i am talking about ajax, but from my understanding ajax is basicly just javascript
You could try this idea. Of course it's dependent upon JS being enabled.
Code:
<form ....... onsubmit="if(document.cookie && document.cookie.match('sentForm')){alert('Once is enough!'); return false;}else{document.cookie='sentForm=yes'}">
logic ali is offline
Reply With Quote
View Public Profile
 
Old 11-07-2006, 01:25 AM Re: Requesting a script
Extreme Talker

Posts: 217
Trades: 0
Well..not entirely sure if it works. Basicly im thinking somthing very similar to the youtube comment system. So that script might work...buuut i still need it so that the info is posted to a php document using ajax
Slick Nick is offline
Reply With Quote
View Public Profile
 
Old 11-07-2006, 07:01 PM Re: Requesting a script
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
bit of a futile exercise really. The comment spammers don't click the submit buttons on your page at all, they use bots to send a HTTP GET or POST request to the page URL with the field names from your page filled in already .

to disable the button once it has been clicked simply add
HTML Code:
onclick="this.disabled='disabled'"
to the submit button
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-07-2006, 07:51 PM Re: Requesting a script
Extreme Talker

Posts: 217
Trades: 0
oh..i didnt know that. Well it sure makes it easier on my site because i have it so that when you submit the comment it brings you to the same page (with the comment posted). Problem is though is that you can just refresh and it double posts. if i must i can just make a redirect page after they post the comment, but i would prefer it to post with ajax
Slick Nick is offline
Reply With Quote
View Public Profile
 
Old 11-08-2006, 02:48 AM Re: Requesting a script
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
The simplest way to eliminate a repost on refresh would be to server-side redirect to the same page after posting rather than simply opening the page.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-09-2006, 02:47 AM Re: Requesting a script
seomumbai's Avatar
Skilled Talker

Posts: 98
Trades: 0
you can write it in the onclick event of the button for disabling it and for also alert and also for post.
seomumbai is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Requesting a script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30382 seconds with 12 queries