Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form id="form">
- <input type="radio" name="location" value="loc01">
- <input type="radio" name="location" value="loc02">
- <input type="radio" name="location" value="loc03">
- </form>
- <script>
- $(function() {
- $('#form').change(function(a) {
- a.preventDefault();
- var formdata = new FormData($(this)[0]);
- $.ajax({
- method: "POST",
- data: formdata,
- contentType: false,
- processData: false,
- success: function(a) { alert('done'); }
- });
- });
- });
- </script>
- <?php
- // simplified
- update_user_meta( $user->ID, 'user_location', $_POST['location'] );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement