hii as i see some code in which we can sent data on the run time when we enter something in input & go for next that post that data into action forum which we define in Ajax action
that is for the checking for username field on run time wihtout loading the page
here is code

<SCRIPT type="text/javascript">
<!--

pic1 = new Image(16, 16); 
pic1.src = "images/loader.gif";

$(document).ready(function(){

$("#username").change(function() { 

var usr = $("#username").val();

if(usr.length >= 4)
{
$("#status").html('<img src="images/loader.gif" align="absmiddle">&nbsp;Checking availability...');

$.ajax({  
type: "POST",  
url: "userchk.php",  
data: "username="+ usr,  
success: function(msg){  

   $("#status").ajaxComplete(function(event, request, settings){ 

if(msg == 'OK')
{ 
    $("#username").removeClass('object_error'); // if necessary
	$("#username").addClass("object_ok");
	$(this).html('&nbsp;<img src="images/tick.gif" align="absmiddle">');
}  
else  
{  
	$("#username").removeClass('object_ok'); // if necessary
	$("#username").addClass("object_error");
	$(this).html(msg);
}  

   });

 } 

  }); 

}
else
	{
	$("#status").html('<font color="red"> username have at least <strong>4</strong> characters.</font>');
	$("#username").removeClass('object_ok'); // if necessary
	$("#username").addClass("object_error");
	}

});

});

//-->
</SCRIPT>

and here we give id in forum input field

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

Simple i want that i can get values of more input field at the same time when user enter data in those

how i'll get that

    mean i can get the values of multiple when we enter values at run time

      10 days later

      IF I understand what you're asking (very difficult when there is a total of one punctuation mark in your entire post, and your shift key appears to be broken)...

      As you've probably figured out,

      var usr = $("#username").val();

      collects the value of one input field. Repeating that for additional fields should be straightforward.

      The collected value(s) get put into the post on this line:

          data: "username="+ usr,  

      My guess would be that conventional urlencoding is being used, so

          data: "username="+ usr+"&somethingelse="+anothervalue,  

      would put two values into the post. But that's just a guess; there is probably something more robust. Since you're using jQuery (which I haven't really used), I'd recommend reading its documentation on how to use the [font=monospace]ajax[/font] object and finding out.

      Oh, and get your shift key fixed.

        Write a Reply...