TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Advanced PHP Programming (http://www.talkphp.com/advanced-php-programming/)
-   -   Sending forms using Jooney (http://www.talkphp.com/advanced-php-programming/2642-sending-forms-using-jooney.html)

Rendair 04-16-2008 11:57 AM

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.

EyeDentify 04-17-2008 06:29 AM

Seems to be some major bugs and errors on the website associated with the framework. But i´m curious on how it works and would like to see more.
Please fix the website and tell us when it runs smoothly.
And i will take a look again :)

Cheers.


All times are GMT. The time now is 10:17 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0