html - How to post form value with span tag in php? -


i have form in there many span elements , every span element have id's span tag working input text field form want send span field value php file insert in db in php $_post['fname'] value can if using input type text if span how this?

my code is:

<form action="form_submit1" method="post">    <div class="form-group">         <span class= "sexyform" id="6" name="fname" data-placeholder="enter first name"></span>         </div> </form> 

you use ajax

$(document).on("click", ".sexyform", function () {    var id=$(this).attr('id');    $.ajax({     type: 'post',     url: "form_submit1",     data:{fname:id},     success: function (result) {        action after success      },   }) }) 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -