Tuesday, August 23rd, 2005

AJFORM 1.0: Ajaxian ToolKit

Category: Toolkit

Brendon Crawford has announced AJFORM 1.0

AJFORM is a JavaScript toolkit which simply submits data from any given form in an HTML page, then sends the data to any specified JavaScript function. AJFORM degrades gracefully in every aspect. In other words, if the browser doesn’t support it, the data will be sent through the form as normal.

What’s different?

AJFORM takes the approach where you add custom attributes to your HTML to let the framework know what to do.

<form action="ajform.php" ajform:handler="getReturnData" ajform:submitonfail="1">
  <table>
	<tr>
		<td>Name:</td>
		<td><input type="text" name="myName" /></td>
	</tr>
	<tr>
		<td>
			<select name="favoriteColor">
				<option value="black">Black</option>
				<option value="red">Red</option>
				<option value="green">Green</option>
			</select>
		</td>
	</tr>
	<tr>
		<td><input type="submit" name="submit" value="SUBMIT" /></td>
	</tr>
  </table>
</form>	

Then you just need to have a JavaScript function called getReturnData(data), and server side code to handle this.

An AJFORM always submits the “ajform:submit” request variable, so you know if it is coming to you via Ajax vs. a standard form request.

ajform.png

Posted by Dion Almaer at 12:30 am
2 Comments

+++--
3.3 rating from 8 votes

2 Comments »

Comments feed

advAJAX can be used fo the same things but it also allows to automaticly block of form controls while sending form, just like other properties of this object just like connection retry, timeouts etc. It’s available on http://advajax.anakin.us/ (form demo is on the bottom of the page, called “System logowania”).
Hope I’ll have time to translate documentation to English :).

Comment by advAJAX — August 23, 2005

uggh, GPL licence.

Comment by foo — August 23, 2005

Leave a comment

You must be logged in to post a comment.