My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

we always use ajax to submit form data,but we should get each of elements value,that is terrible,if the form have many form elements how we can do? eg:

 

<input type="text" name="username" value="" />

<input type="password" name="password" value="" />

<input type="text" name="nikename" value="" />

<input type="text" name="interest" value="" />

............................many............

dataForAjax

can collect all of form elements to be a string,which you can use like GET or POST,it can be use to collect text,password,textarea,hidden,checkbox,radio,select eg:

 <div id="biuuu"> 

<input type="text" name="username" value="" />

<input type="text" name="nickname" value="" />

<input type="password" name="password" value="" />

<input type="radio" name="gender" value="male" />male

<input type="radio" name="gender" value="female" />female

<select name="job">

<option value="jquery" selected>jquery</option>

<option value="php">php</option>

<option value="mysql">mysql</option>

</select><br />

<input type="checkbox" name="interest" value="jquery" />jquery

<input type="checkbox" name="interest" value="php" />php

<input type="checkbox" name="interest" value="mysql" />mysql

<textarea rows="5" cols="20" name="introduce"></textarea>

<input type="button" value="submit" id="button">

<div id="showmessage"></div>

</div>

 

var data = jQuery("#biuuu").dataForAjax({ showMessage:'showmessage', message:{ 'username':'username cann`t be empty', 'password':"password cann`t be empty" } });

if the value cann`t be null(like username,password),you can define it,it use very easy,

showMessage is the ID which you want to show error infomation message is the array which you define to show error infomation

dataforajax DEMO

hope you like !

Powered by Google Project Hosting