TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 04-16-2008, 11:57 AM   #1 (permalink)
The Addict
Upcoming Programmer Top Contributor 
 
Rendair's Avatar
 
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
Rendair is on a distinguished road
Default Sending forms using Jooney

Now you all might now i made my own JSFramework. Well i thought i would write a tutorial on how you can use some of the features. Plus it gets it known out there in the big world so

Sending Forms with Jooney

It is very easy to process forms with Jooney. It is designed to make it easier for the user to be able to process forms using Ajax. Jooney will automatically set up all the fields in the form and send them as GET.

First off though i guess it would be a good idea to download Jooney

http://www.jooney.co.uk/download/

And of course place the following code at the top of your page

PHP Code:
<script type="text/javascript" src="javascript/jooney.js"></script> 
We can now started using Jooney.

PHP Code:
<form id="form1" name="form1" method="post" action="">
  <
input type="text" name="textfield" id="textfield" />
  <
input type="submit" name="button" id="button" value="Submit" />
</
form
As of yet Jooney form cant deal with tables when used with forms. So if you put a form in a table then it cant read all the fields and wont pass them all.

We have our form set up anyway. Now we can easily send this form by changing the input field to a button and placing a onClick.

PHP Code:
<form id="form1" name="form1" method="post" action="">
  <
input type="text" name="textfield" id="textfield" />
  <
input type="button" name="button" id="button" value="Submit" onClick="$.Ajax.form('form1','process.php','divID');"/>
</
form
We have used the following line of code

PHP Code:
$.Ajax.form('form1','process.php','divID'); 
We have set 3 things

1. The form ID
2. The page where you will deal with the results
3. The DivID that will show the results when the request was run.
__________________
www.jooney.co.uk - the online portfolio
Send a message via MSN to Rendair
Rendair is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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


All times are GMT. The time now is 04:44 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design