forms - PHP How to get an input values type through $_POST -


hi sending form through post php file have made. have been able use $_post["name"] vales of input fields of type text/password,/etc 'type'. in variable $car = $_post["car"]; store value, $carinputtype store inputs type. if in form person chose mazda in checkbox, $carinputtype hold 'checkbox' type.

i hope explained think useful many people learn. have been looking around have not found answer this. have tried:

$radio = $_post["fname[type]"]; $radio = $_post["fname[type=]"]; 

a bit of form follows:

<form id="ajax-form" onsubmit="return false;"> <div><label for="uname">username <em>*</em></label> <input id="uname"     type="text" name="uname" value=""  /><p class='note' id = "usernameid"></p>        </div> </form> 

any appreciated. thank reviewing post.

you can't php. use javascript or jquery build post data need it.

var data =    $('#myform').serializearray();     data.push({     name: 'elementname',      value: 'elementvalue',     type: 'element type' });  $.post("page.php", data); 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -