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

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -