Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- var predvolba = $('#predvolbaEditace').val();
- $(function() {
- $('#predvolbaEditace').keydown(function() {
- predvolba = $('#predvolbaEditace').val();
- console.log(predvolba);
- });
- console.log(predvolba);
- if (predvolba == "") {
- $('#predvolbaEditace').focus(function() {
- $(this).val("+ ");
- });
- $('#predvolbaEditace').blur(function() {
- $(this).val("");
- });
- }
- })
- $("#predvolbaEditace").keydown(function(event) {
- console.log(this.selectionStart);
- console.log(event);
- if (event.keyCode == 8) {
- this.selectionStart--;
- }
- if (this.selectionStart < 2) {
- this.selectionStart = 2;
- console.log(this.selectionStart);
- event.preventDefault();
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement