Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

multi select checkbox but post only first  #5

@tablecell

Description

@tablecell
<form id="myform" method="post" action="form.php">
	<div class="form-field">
			<h5>	checkbox example	</h5>
		 
			<input type="checkbox" value="english" name="language" />English 
 			<input type="checkbox" value="french" name="language" />French 
			<input type="checkbox" value="german" name="language" />German 
	</div>
	<input type="submit" id="btn" />
</form>
<script>
    $(document).ready(function(){
	 $("#btn").click(function(){
	  $.post('/',$("#myform").serialize(),function(data){
        	console.log(data);
	  });
	
	 return false;
	
	 });
	
	});
</script>
form.php
<?php

print_r($_POST);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions