dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Minimum input value

  1. #1
    Join Date
    Dec 2009
    Posts
    13

    Minimum input value

    HTML Code:
    <script type="text/javascript">
    
    $.fn.updater = function ()
    {
    	$("div#db_res").load('result.php', { qs: $(this).val() });
    	return this;
    };
    
    $(document).ready(function(){
    
    	$("input[name='qs']").updater().focus().keyup(function(){
    		var str = $(this).val(); 
    		$("div#result").html( "Input: " + str ); 
    		$(this).updater(str);
    	});
    
    });
    </script>
    	
    	<form action="index.php" method="get">
    	<input type="text" name="qs" value="">
    	</form>
    I have a form like above that load a page soon something is typed into a text field, but I want minimum value, eg minimum 3 character is typed before it loads. Can this be dune somehow?

  2. #2
    Join Date
    Dec 2009
    Posts
    13
    Anyone know how to use this jquerys minlength function with above code?
    http://docs.jquery.com/Plugins/Valid...nlength#length

    HTML Code:
    $("#myform").validate({
      rules: {
        field: {
          required: true,
          minlength: 3
        }
      }
    });
    This 2 functions in first post is also jquery function but canít find out how to use this with it. Anyone know how to use?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles