How to update two input windows in jquery

I create two text input fields: one for the title and the other for the permalink

I need to update the second file automatically when the user enters tilte

how can i do such a thing in jquery / php

somehow he is looking for a way to mimic the creation of a Wordpress permalink in a post office

+4
source share
3 answers
$('#first_input_id').bind('keydown', function(e){ var inputmirror = $('#second_input_id'); inputmirror.val(inputmirror.val() + String.fromCharCode(e.which)); }); 

Something like this should do it.

+3
source

Write a function to read from the current input, make it as you like, and paste it into another input.

Then bind this function to clicking and changing events.

0
source

You can catch the keyup event on the first input text, and then update the output of the second input:

  $('#titleInput').keypress(function(e) { alert ('typed' + String.fromCharCode(e.keyCode))//update your 2nd input text... } 
0
source

Source: https://habr.com/ru/post/1307529/


All Articles