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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.