javascript - Replacing numbers in a text field upon typing new numbers using java script or Jquery -


the question suppose have text box in html form value example 05/09/2013.upon click of calendar icon value in text box.

now click in text box , type or change value 06/09/2013.here while typing if press 6 should replace 5.(but when press 6 should not 065/09/2013).if press 6 should replace 5.

so how replace numbers upon typing using java script / jquery.

i came know onkeypress() in javascript can used.

but how proceed further?

thanks in advance :)

i 1 of 2 methods,

method 1.

 $(function() {        var textinp = $('textfield').val();       setinterval(function() {         $('inputfield').val(textinp);    }), 100);  }); 

or method 2

$(document).ready(function() {   $('text').focusout(function() {      $('input').val($(this).val());    }); }); 

either 1 work, recommend 1. each own.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -