function tr...">

Can I do this using PHP?

Consider

  <html>
      <head>
          <title>txt with js eff</title>
      </head>

      <body>
          <script type = "text/javascript">
              function transfer(which) {
                  document.getElementById("temp_name").value = which;
              }
          </script>

          <form action="" method="post" name="frm1">
              <label> In put 1 </label>
              <input
                type="text"
                name="username"
                id = "username"
                onkeyup = "transfer(this.value)"><br/><br/>

              <label> In put 2 </label>
              <input
                type="text"
                name="temp_name"
                id = "temp_name">
          </form>
      </body>
  </html>

I need to do this using PHP:

I need to pass the value " Insert 2 " from " Insert 1 " when the user directs his cursor to the next field. I can do this very easily with JavaScript, but I need it with PHP.

Is there a solution?

+3
source share
5 answers

PHP, Javascript. PHP . , PHP javascript, , . , PHP, Javascript.

+12

PHP - , - , . , , . , javascript. , , .

, , .

+6

, PHP.

Quotes, , , , . ?

+2

"-" , "-" .

"- ", , , , .. -, . , , PHP, PHP . , , - , JavaScript .

0

Perhaps you want to keep the values. Just call the submit method after making changes to JavaScript, and then save it in the database or in the session or whatever. Or maybe you can make an Ajax request to avoid page reloading, but it's really hard to understand what you are trying to achieve or understand.

0
source

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


All Articles