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
Submit Form without refreshing?
Old 05-31-2008, 12:09 PM Submit Form without refreshing?
Sydpix's Avatar
Drinker I Smoke

Posts: 424
Name: Denny
Location: In a can...
Trades: 0
I need to submit a form without refreshing the page the form is being submited from?


Code:
<textarea name="message" cols="65" rows="10" id="message" ><?php echo $_GET['message'];?></textarea>
 <br />


  <input name="Submit" type="submit"  value="Send Message" target="_new" />

   </form>
__________________
.
Village Idiot

Sydpix is offline
Reply With Quote
View Public Profile Visit Sydpix's homepage!
 
 
Register now for full access!
Old 05-31-2008, 12:22 PM Re: Submit Form without refreshing?
Super Talker

Posts: 129
Trades: 1
can i ask, why you dont want to refresh
yourmediaking is offline
Reply With Quote
View Public Profile
 
Old 05-31-2008, 12:32 PM Re: Submit Form without refreshing?
Sydpix's Avatar
Drinker I Smoke

Posts: 424
Name: Denny
Location: In a can...
Trades: 0
Well... it has a captcha form on it and if the user submits the wrong number, because it's inside a Prototype slider, the slider returns to the first section and the user doesn't know the number was wrong unless he scrolls back to the contact location.

I might just have to rethink the slider.
__________________
.
Village Idiot

Sydpix is offline
Reply With Quote
View Public Profile Visit Sydpix's homepage!
 
Old 05-31-2008, 04:07 PM Re: Submit Form without refreshing?
upstarter's Avatar
Average Talker

Posts: 26
Name: Starr Horne
Trades: 0
Sure you can. The easiest way is to do an ajax POST request. Prototype makes this dead easy:

http://www.prototypejs.org/api/ajax/request

You'll also need to serialize any data in your form, using the Form.serialize method:

http://www.prototypejs.org/api/form/serialize

PM me if you need any help.
__________________
my company:
Please login or register to view this content. Registration is FREE


my blog:
Please login or register to view this content. Registration is FREE
upstarter is offline
Reply With Quote
View Public Profile Visit upstarter's homepage!
 
Old 05-31-2008, 08:08 PM Re: Submit Form without refreshing?
Banned

Posts: 32
Trades: 0
lol, do whatever you do, never use prototype...you will use an atomic bom to kill a moskito
Elenis is offline
Reply With Quote
View Public Profile
 
Old 05-31-2008, 09:18 PM Re: Submit Form without refreshing?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I use Jquery, it is super lightweight (about 30k minified) and makes ajax calls a cinch.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.

Last edited by wayfarer07; 05-31-2008 at 09:19 PM..
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 06-01-2008, 11:50 AM Re: Submit Form without refreshing?
upstarter's Avatar
Average Talker

Posts: 26
Name: Starr Horne
Trades: 0
The reason I gave a prototype example was that he said he was already using it. So no reason to add another JS lib on top.
__________________
my company:
Please login or register to view this content. Registration is FREE


my blog:
Please login or register to view this content. Registration is FREE
upstarter is offline
Reply With Quote
View Public Profile Visit upstarter's homepage!
 
Reply     « Reply to Submit Form without refreshing?
 

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.18369 seconds with 12 queries