Jump to content

how to get values without page Upload


realcoder

Recommended Posts

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"> 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(' <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

Link to comment
https://forums.phpfreaks.com/topic/222593-how-to-get-values-without-page-upload/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.