简体   繁体   English

有没有办法使用 javascript 自动填充 html 输入

[英]Is there any way to fill the html inputs automatically using javascript

<form action="duzenle.php" method="POST" autocomplete="on">


    Ad Soyad <input  type="text" name="name" id="aaa">

    <br>  <br>

    Telefon <input type="number" name="tel"  placeholder="">

    <br> <br>

    E-Posta <input type="mail" name="mail" placeholder="">

    <br> <br>

    Cari Kart Kodu <input type="number" name="cck" placeholder="">

    <br> <br>

    Olusturma Tarihi <input type="date" name="createdate">
    
    <br> <br>

    <input type="submit" class="button" value="Listele" name="bb">

    <br>  <br>


    <input type="submit" style="position: absolute;left:69px;top:207px; class="button value="Güncelle" name="bc"> 

    <select name="data_id" id="data_id">

        <option value="1">1.Data</option>
        <option value="2">2.Data</option>
        <option value="3">3.Data</option>
    </select>


    <input type="submit"value="Data Göster" name="www" onclick="myFunction()">
    

    <br> <br>


    <script>
        function myFunction() 
        {
          var a= document.getElementById("aaa").values;
            }

So i take the inputs from the user and save it to sql.What i am trying to do is when i click the data göster(show data) button it should automatically fill the Ad Soyad(name-surname),Telefone(phone) etc.因此,我从用户那里获取输入并将其保存到 sql。我想要做的是当我单击数据 göster(显示数据)按钮时,它应该自动填充 Ad Soyad(姓名),电话(电话)等.

I tried using getElementById method but couldn't figure out.Thank you.我尝试使用 getElementById 方法,但无法弄清楚。谢谢。

İlk öncə values yox value və, hansısa input elementinin daxilinə SQL-dən məlumat ötürmək istəyirsinizsə bunun üçün Ajax texnologiyasından istifadə edə bilərsiniz. İlk öncə values yox value və, hansısa input elementinin daxilinə SQL-dən məlumat ötürmək istəyirsinizsə bunun üçün Ajax texnologiyasından istifadə edə bilərsiniz。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM