SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Oct 2010
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to get values without page Upload

    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

    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

  2. #2
    SitePoint Addict
    Join Date
    Oct 2010
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mean i can get the values of multiple when we enter values at run time


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •